|
|
@ -24,6 +24,7 @@ import static org.hamcrest.CoreMatchers.hasItem; |
|
|
|
import static org.hamcrest.CoreMatchers.is; |
|
|
|
import static org.hamcrest.CoreMatchers.is; |
|
|
|
import static org.hamcrest.CoreMatchers.nullValue; |
|
|
|
import static org.hamcrest.CoreMatchers.nullValue; |
|
|
|
import static org.hamcrest.collection.IsCollectionWithSize.hasSize; |
|
|
|
import static org.hamcrest.collection.IsCollectionWithSize.hasSize; |
|
|
|
|
|
|
|
import static org.junit.Assert.assertEquals; |
|
|
|
import static org.junit.Assert.assertThat; |
|
|
|
import static org.junit.Assert.assertThat; |
|
|
|
import org.junit.Test; |
|
|
|
import org.junit.Test; |
|
|
|
import org.springframework.cloud.netflix.zuul.filters.ZuulProperties.ZuulRoute; |
|
|
|
import org.springframework.cloud.netflix.zuul.filters.ZuulProperties.ZuulRoute; |
|
|
@ -58,6 +59,16 @@ public class SimpleRouteLocatorTests { |
|
|
|
assertThat(routes, hasSize(1)); |
|
|
|
assertThat(routes, hasSize(1)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
public void testStripPrefix() { |
|
|
|
|
|
|
|
ZuulProperties properties = new ZuulProperties(); |
|
|
|
|
|
|
|
properties.setPrefix("/test"); |
|
|
|
|
|
|
|
properties.setStripPrefix(true); |
|
|
|
|
|
|
|
RouteLocator locator = new FilteringRouteLocator("/", properties); |
|
|
|
|
|
|
|
properties.getRoutes().put("testservicea", new ZuulRoute("/testservicea/**", "testservicea")); |
|
|
|
|
|
|
|
assertEquals("/test/testservicea/**", locator.getRoutes().get(0).getFullPath()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void test_getMatchingRouteFilterRouteAcceptor() { |
|
|
|
public void test_getMatchingRouteFilterRouteAcceptor() { |
|
|
|
RouteLocator locator = new FilteringRouteLocator("/", this.zuul); |
|
|
|
RouteLocator locator = new FilteringRouteLocator("/", this.zuul); |
|
|
|