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
Post a Comment