Browse Source

clearing context during setup

pull/6/head
Ryan Baxter 8 years ago
parent
commit
fc9c7dcdfc
  1. 11
      spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/zuul/filters/route/support/RibbonRetryIntegrationTestBase.java

11
spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/zuul/filters/route/support/RibbonRetryIntegrationTestBase.java

@ -19,6 +19,8 @@ @@ -19,6 +19,8 @@
package org.springframework.cloud.netflix.zuul.filters.route.support;
import java.util.logging.Logger;
import javax.servlet.http.HttpServletRequest;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Value;
@ -28,20 +30,28 @@ import org.springframework.cloud.netflix.ribbon.RibbonClient; @@ -28,20 +30,28 @@ import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.cloud.netflix.ribbon.RibbonClients;
import org.springframework.cloud.netflix.ribbon.StaticServerList;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.cloud.netflix.zuul.filters.post.SendErrorFilter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.netflix.loadbalancer.Server;
import com.netflix.loadbalancer.ServerList;
import com.netflix.zuul.context.RequestContext;
import com.netflix.zuul.exception.ZuulException;
import com.netflix.zuul.monitoring.MonitoringHelper;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
/**
* @author Ryan Baxter
@ -55,6 +65,7 @@ public abstract class RibbonRetryIntegrationTestBase { @@ -55,6 +65,7 @@ public abstract class RibbonRetryIntegrationTestBase {
@Before
public void setup() {
RequestContext.getCurrentContext().clear();
String uri = "/resetError";
new TestRestTemplate().exchange(
"http://localhost:" + this.port + uri, HttpMethod.GET,

Loading…
Cancel
Save