Browse Source

Migrates to new OutputCaptureRule

pull/1120/head
Spencer Gibb 5 years ago
parent
commit
a47f232fb1
No known key found for this signature in database
GPG Key ID: 7788A47380690861
  1. 10
      spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/filter/factory/RetryGatewayFilterFactoryIntegrationTests.java
  2. 4
      spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/handler/RoutePredicateHandlerMappingTests.java
  3. 4
      spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/handler/predicate/QueryRoutePredicateFactoryTests.java

10
spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/filter/factory/RetryGatewayFilterFactoryIntegrationTests.java

@ -27,7 +27,6 @@ import com.netflix.loadbalancer.ServerList; @@ -27,7 +27,6 @@ import com.netflix.loadbalancer.ServerList;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hamcrest.CoreMatchers;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@ -37,7 +36,7 @@ import org.springframework.beans.factory.annotation.Value; @@ -37,7 +36,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.rule.OutputCapture;
import org.springframework.boot.test.system.OutputCaptureRule;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.cloud.gateway.filter.GatewayFilter;
import org.springframework.cloud.gateway.filter.factory.RetryGatewayFilterFactory.RetryConfig;
@ -75,12 +74,7 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen @@ -75,12 +74,7 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen
public class RetryGatewayFilterFactoryIntegrationTests extends BaseWebClientTests {
@Rule
public final OutputCapture capture = new OutputCapture();
@Before
public void before() {
capture.reset();
}
public final OutputCaptureRule capture = new OutputCaptureRule();
@Test
public void retryFilterGet() {

4
spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/handler/RoutePredicateHandlerMappingTests.java

@ -23,7 +23,7 @@ import reactor.core.publisher.Flux; @@ -23,7 +23,7 @@ import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import reactor.test.StepVerifier;
import org.springframework.boot.test.rule.OutputCapture;
import org.springframework.boot.test.system.OutputCaptureRule;
import org.springframework.cloud.gateway.config.GlobalCorsProperties;
import org.springframework.cloud.gateway.route.Route;
import org.springframework.cloud.gateway.route.RouteLocator;
@ -38,7 +38,7 @@ import static org.hamcrest.Matchers.containsString; @@ -38,7 +38,7 @@ import static org.hamcrest.Matchers.containsString;
public class RoutePredicateHandlerMappingTests {
@Rule
public OutputCapture outputCapture = new OutputCapture();
public OutputCaptureRule outputCapture = new OutputCaptureRule();
@Test
public void lookupRouteFromSyncPredicates() {

4
spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/handler/predicate/QueryRoutePredicateFactoryTests.java

@ -26,7 +26,7 @@ import org.springframework.beans.factory.annotation.Value; @@ -26,7 +26,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.rule.OutputCapture;
import org.springframework.boot.test.system.OutputCaptureRule;
import org.springframework.cloud.gateway.handler.predicate.QueryRoutePredicateFactory.Config;
import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
@ -47,7 +47,7 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen @@ -47,7 +47,7 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen
public class QueryRoutePredicateFactoryTests extends BaseWebClientTests {
@Rule
public OutputCapture output = new OutputCapture();
public OutputCaptureRule output = new OutputCaptureRule();
@Test
public void noQueryParamWorks() {

Loading…
Cancel
Save