java - Test case in spring boot(mockmvc) not supporting Resttemplate -


i using mock mvc in test case , working fine (with out start full http server). if use resttemplate in service controller communicating service coming 'unknown host exception' while running test case. service spring boot application , registered in eureka server.

my code this

@autowired private resttemplate participantsresttemplate; string url = "http://account-micro-service/api/account/accounts.json"; resttemplate.exchange(url, httpmethod.post, body, string.class); 

'account-micro-service' service name service registered in eureka server


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

c# SetCompatibleTextRenderingDefault must be called before the first -

Laravel mail error `Swift_TransportException in StreamBuffer.php line 269: Connection could not be established with host smtp.gmail.com [ #0]` -