Commit 05eef0e8 by Gregor Zurowski

Use filter constants

parent c2c63470
......@@ -63,6 +63,7 @@ import org.springframework.web.multipart.MultipartFile;
import static java.nio.charset.Charset.defaultCharset;
import static org.junit.Assert.assertEquals;
import static org.springframework.cloud.netflix.zuul.filters.support.FilterConstants.PRE_TYPE;
import static org.springframework.util.StreamUtils.copyToString;
import lombok.extern.slf4j.Slf4j;
......@@ -271,7 +272,7 @@ class FormZuulProxyApplication {
@Override
public String filterType() {
return "pre";
return PRE_TYPE;
}
@Override
......
......@@ -61,6 +61,7 @@ import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import static org.junit.Assert.assertEquals;
import static org.springframework.cloud.netflix.zuul.filters.support.FilterConstants.PRE_TYPE;
import lombok.extern.slf4j.Slf4j;
......@@ -181,7 +182,7 @@ class FormZuulServletProxyApplication {
@Override
public String filterType() {
return "pre";
return PRE_TYPE;
}
@Override
......
......@@ -37,6 +37,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import static org.junit.Assert.assertEquals;
import static org.springframework.cloud.netflix.zuul.filters.support.FilterConstants.PRE_TYPE;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = RetryableZuulProxyApplication.class, webEnvironment = WebEnvironment.RANDOM_PORT, value = {
......@@ -100,7 +101,7 @@ class RetryableZuulProxyApplication {
return new ZuulFilter() {
@Override
public String filterType() {
return "pre";
return PRE_TYPE;
}
@Override
......
......@@ -45,6 +45,7 @@ import org.springframework.web.bind.annotation.RestController;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.springframework.cloud.netflix.zuul.filters.support.FilterConstants.PRE_TYPE;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = SimpleZuulServerApplication.class, webEnvironment = WebEnvironment.RANDOM_PORT)
......@@ -119,7 +120,7 @@ class SimpleZuulServerApplication {
return new ZuulFilter() {
@Override
public String filterType() {
return "pre";
return PRE_TYPE;
}
@Override
......
......@@ -47,6 +47,9 @@ import org.springframework.web.bind.annotation.RestController;
import static org.assertj.core.api.Assertions.assertThat;
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
import static org.springframework.cloud.netflix.zuul.filters.support.FilterConstants.POST_TYPE;
import static org.springframework.cloud.netflix.zuul.filters.support.FilterConstants.PRE_TYPE;
import static org.springframework.cloud.netflix.zuul.filters.support.FilterConstants.ROUTE_TYPE;
/**
* @author Spencer Gibb
......@@ -111,7 +114,7 @@ public class SendErrorFilterIntegrationTests {
return new FailureFilter() {
@Override
public String filterType() {
return "pre";
return PRE_TYPE;
}
};
}
......@@ -121,7 +124,7 @@ public class SendErrorFilterIntegrationTests {
return new FailureFilter() {
@Override
public String filterType() {
return "route";
return ROUTE_TYPE;
}
};
}
......@@ -131,7 +134,7 @@ public class SendErrorFilterIntegrationTests {
return new FailureFilter() {
@Override
public String filterType() {
return "post";
return POST_TYPE;
}
};
}
......
......@@ -42,6 +42,7 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.MockitoAnnotations.initMocks;
import static org.springframework.cloud.netflix.zuul.filters.support.FilterConstants.FORWARD_TO_KEY;
import static org.springframework.cloud.netflix.zuul.filters.support.FilterConstants.PRE_TYPE;
import static org.springframework.cloud.netflix.zuul.filters.support.FilterConstants.REQUEST_URI_KEY;
import static org.springframework.cloud.netflix.zuul.filters.support.FilterConstants.SERVICE_ID_KEY;
......@@ -85,7 +86,7 @@ public class PreDecorationFilterTests {
public void basicProperties() throws Exception {
assertEquals(5, this.filter.filterOrder());
assertEquals(true, this.filter.shouldFilter());
assertEquals("pre", this.filter.filterType());
assertEquals(PRE_TYPE, this.filter.filterType());
}
@Test
......
......@@ -82,6 +82,7 @@ import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assume.assumeThat;
import static org.springframework.cloud.netflix.zuul.filters.support.FilterConstants.PRE_TYPE;
/**
* @author Spencer Gibb
......@@ -406,7 +407,7 @@ public abstract class ZuulProxyTestBase {
return new ZuulFilter() {
@Override
public String filterType() {
return "pre";
return PRE_TYPE;
}
@Override
......
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