Separate configuration for filter tests

This commit is contained in:
Biju Kunjummen
2017-06-16 07:39:01 -07:00
parent 2d5169e24d
commit 4d81c46936
4 changed files with 46 additions and 10 deletions

View File

@@ -17,9 +17,6 @@
package org.springframework.cloud.gateway.filter.factory;
import java.time.Duration;
import java.util.Map;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.SpringBootConfiguration;
@@ -28,19 +25,28 @@ import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.cloud.gateway.test.BaseWebClientTests;
import org.springframework.context.annotation.Import;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
import reactor.core.publisher.Mono;
import reactor.test.StepVerifier;
import java.time.Duration;
import java.util.Map;
import static org.assertj.core.api.Assertions.assertThat;
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
import static org.springframework.cloud.gateway.test.TestUtils.getMap;
import static org.springframework.web.reactive.function.BodyExtractors.toMono;
import reactor.core.publisher.Mono;
import reactor.test.StepVerifier;
/**
* @author Spencer Gibb
* @author Biju Kunjummen
*/
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = RANDOM_PORT)
@DirtiesContext
@ActiveProfiles(profiles = "request-header-web-filter")
public class AddRequestHeaderWebFilterFactoryTests extends BaseWebClientTests {
@Test

View File

@@ -17,8 +17,6 @@
package org.springframework.cloud.gateway.filter.factory;
import java.util.Map;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.SpringBootConfiguration;
@@ -27,19 +25,22 @@ import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.cloud.gateway.test.BaseWebClientTests;
import org.springframework.context.annotation.Import;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
import reactor.core.publisher.Mono;
import reactor.test.StepVerifier;
import java.util.Map;
import static org.assertj.core.api.Assertions.assertThat;
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
import static org.springframework.cloud.gateway.test.TestUtils.getMap;
import static org.springframework.web.reactive.function.BodyExtractors.toMono;
import reactor.core.publisher.Mono;
import reactor.test.StepVerifier;
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = RANDOM_PORT)
@DirtiesContext
@ActiveProfiles(profiles = "request-parameter-web-filter")
public class AddRequestParameterWebFilterFactoryTests extends BaseWebClientTests {
@Test

View File

@@ -0,0 +1,14 @@
test:
hostport: httpbin.org:80
uri: lb://testservice
spring:
cloud:
gateway:
routes:
- id: add_request_header_test
uri: ${test.uri}
predicates:
- Path=/headers
filters:
- AddRequestHeader=X-Request-Foo, Bar

View File

@@ -0,0 +1,15 @@
test:
hostport: httpbin.org:80
uri: lb://testservice
spring:
cloud:
gateway:
routes:
- id: add_request_parameter_test
uri: ${test.uri}
predicates:
- Host=**.addrequestparameter.org
- Path=/get
filters:
- AddRequestParameter=foo, bar