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

c# SetCompatibleTextRenderingDefault must be called before the first -

c++ - Fill runtime data at compile time with templates -

C#.NET Oracle.ManagedDataAccess ConfigSchema.xsd -