Unverified Commit 4fd36592 by Daniel Lavoie Committed by Spencer Gibb

Fix RestTemplateRetryTest Unit test

parent 4a1e637b
...@@ -12,15 +12,14 @@ import org.junit.runner.RunWith; ...@@ -12,15 +12,14 @@ import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.test.IntegrationTest;
import org.springframework.boot.test.SpringApplicationConfiguration; import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.boot.test.WebIntegrationTest;
import org.springframework.cloud.client.loadbalancer.LoadBalanced; import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.ribbon.RibbonClient; import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
...@@ -43,13 +42,10 @@ import com.netflix.niws.client.http.HttpClientLoadBalancerErrorHandler; ...@@ -43,13 +42,10 @@ import com.netflix.niws.client.http.HttpClientLoadBalancerErrorHandler;
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = RestTemplateRetryTest.Application.class) @SpringApplicationConfiguration(classes = RestTemplateRetryTest.Application.class)
@WebAppConfiguration @WebIntegrationTest(randomPort = true, value = {
@IntegrationTest({
"server.port=0",
"spring.application.name=resttemplatetest", "spring.application.name=resttemplatetest",
"logging.level.org.springframework.cloud.netflix.resttemplate=DEBUG", "logging.level.org.springframework.cloud.netflix.resttemplate=DEBUG",
"badClients.ribbon.MaxAutoRetries=0", "badClients.ribbon.ReadTimeout=200", "badClients.ribbon.MaxAutoRetries=0",
"badClients.ribbon.MaxAutoRetriesNextServer=10",
"badClients.ribbon.OkToRetryOnAllOperations=true", "ribbon.http.client.enabled" }) "badClients.ribbon.OkToRetryOnAllOperations=true", "ribbon.http.client.enabled" })
@DirtiesContext @DirtiesContext
public class RestTemplateRetryTest { public class RestTemplateRetryTest {
......
...@@ -26,6 +26,10 @@ foo: ...@@ -26,6 +26,10 @@ foo:
ribbon: ribbon:
ConnectTimeout: 7 ConnectTimeout: 7
ReadTimeout: 17 ReadTimeout: 17
badClients:
ribbon:
MaxAutoRetriesNextServer: 10
ReadTimeout: 200
management: management:
context-path: /admin context-path: /admin
endpoints: endpoints:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment