Use modern language features in tests
This commit is contained in:
@@ -111,7 +111,7 @@ public class BodyExtractorsTests {
|
||||
return hints;
|
||||
}
|
||||
};
|
||||
this.hints = new HashMap<String, Object>();
|
||||
this.hints = new HashMap<>();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@ import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.web.server.ResponseStatusException;
|
||||
import org.springframework.web.server.ServerWebExchange;
|
||||
import org.springframework.web.server.WebFilter;
|
||||
import org.springframework.web.server.WebFilterChain;
|
||||
import org.springframework.web.testfixture.http.server.reactive.MockServerHttpRequest;
|
||||
import org.springframework.web.testfixture.http.server.reactive.MockServerHttpResponse;
|
||||
import org.springframework.web.testfixture.server.MockServerWebExchange;
|
||||
@@ -295,12 +294,9 @@ public class RouterFunctionsTests {
|
||||
public void toHttpHandlerWebFilter() {
|
||||
AtomicBoolean filterInvoked = new AtomicBoolean();
|
||||
|
||||
WebFilter webFilter = new WebFilter() {
|
||||
@Override
|
||||
public Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain) {
|
||||
filterInvoked.set(true);
|
||||
return chain.filter(exchange);
|
||||
}
|
||||
WebFilter webFilter = (exchange, chain) -> {
|
||||
filterInvoked.set(true);
|
||||
return chain.filter(exchange);
|
||||
};
|
||||
|
||||
HandlerFunction<ServerResponse> handlerFunction = request -> ServerResponse.accepted().build();
|
||||
|
||||
@@ -164,7 +164,7 @@ public class ResourceUrlProviderTests {
|
||||
|
||||
|
||||
private Condition<PathPattern> pathPatternStringOf(String expected) {
|
||||
return new Condition<PathPattern>(
|
||||
return new Condition<>(
|
||||
actual -> actual != null && actual.getPatternString().equals(expected),
|
||||
"Pattern %s", expected);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user