Clean up warnings in Gradle build
This commit is contained in:
@@ -41,8 +41,7 @@ class AspectProxyFactoryTests {
|
||||
@Test
|
||||
void testWithNonAspect() {
|
||||
AspectJProxyFactory proxyFactory = new AspectJProxyFactory(new TestBean());
|
||||
assertThatIllegalArgumentException().isThrownBy(() ->
|
||||
proxyFactory.addAspect(TestBean.class));
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> proxyFactory.addAspect(TestBean.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -78,8 +77,7 @@ class AspectProxyFactoryTests {
|
||||
@Test
|
||||
void testWithInstanceWithNonAspect() {
|
||||
AspectJProxyFactory pf = new AspectJProxyFactory();
|
||||
assertThatIllegalArgumentException().isThrownBy(() ->
|
||||
pf.addAspect(new TestBean()));
|
||||
assertThatIllegalArgumentException().isThrownBy(() -> pf.addAspect(new TestBean()));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -119,6 +117,7 @@ class AspectProxyFactoryTests {
|
||||
}
|
||||
|
||||
@Test // SPR-13328
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testProxiedVarargsWithEnumArray() {
|
||||
AspectJProxyFactory proxyFactory = new AspectJProxyFactory(new TestBean());
|
||||
proxyFactory.addAspect(LoggingAspectOnVarargs.class);
|
||||
@@ -127,6 +126,7 @@ class AspectProxyFactoryTests {
|
||||
}
|
||||
|
||||
@Test // SPR-13328
|
||||
@SuppressWarnings("unchecked")
|
||||
public void testUnproxiedVarargsWithEnumArray() {
|
||||
AspectJProxyFactory proxyFactory = new AspectJProxyFactory(new TestBean());
|
||||
proxyFactory.addAspect(LoggingAspectOnSetter.class);
|
||||
|
||||
@@ -119,6 +119,7 @@ class FormHttpMessageConverterTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
void readFormMultiValue() throws Exception {
|
||||
String body = "name+1=value+1&name+2=value+2%2B1&name+2=value+2%2B2&name+3";
|
||||
MockHttpInputMessage inputMessage = new MockHttpInputMessage(body.getBytes(StandardCharsets.ISO_8859_1));
|
||||
@@ -134,7 +135,7 @@ class FormHttpMessageConverterTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("rawtypes")
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
void readFormSingleValue() throws Exception {
|
||||
String body = "name+1=value+1&name+2=value+2%2B1&name+2=value+2%2B2&name+3";
|
||||
MockHttpInputMessage inputMessage = new MockHttpInputMessage(body.getBytes(StandardCharsets.ISO_8859_1));
|
||||
|
||||
@@ -58,7 +58,6 @@ class RequestAttributesThreadLocalAccessorTests {
|
||||
@MethodSource
|
||||
@SuppressWarnings({ "try", "unused" })
|
||||
void propagation(RequestAttributes previousRequest, RequestAttributes currentRequest) throws Exception {
|
||||
|
||||
ContextSnapshot snapshot = getSnapshotFor(currentRequest);
|
||||
|
||||
AtomicReference<RequestAttributes> requestInScope = new AtomicReference<>();
|
||||
@@ -80,6 +79,7 @@ class RequestAttributesThreadLocalAccessorTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("try")
|
||||
void accessAfterRequestMarkedCompleted() {
|
||||
MockHttpServletRequest servletRequest = new MockHttpServletRequest();
|
||||
servletRequest.setAttribute("k1", "v1");
|
||||
@@ -100,8 +100,8 @@ class RequestAttributesThreadLocalAccessorTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("try")
|
||||
void accessBeforeRequestMarkedCompleted() {
|
||||
|
||||
MockHttpServletRequest servletRequest = new MockHttpServletRequest();
|
||||
ServletRequestAttributes previous = new ServletRequestAttributes(servletRequest, new MockHttpServletResponse());
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -19,9 +19,11 @@ package org.springframework.web.testfixture.http.server.reactive.bootstrap;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import io.netty.handler.ssl.SslContextBuilder;
|
||||
import io.netty.handler.ssl.util.SelfSignedCertificate;
|
||||
import reactor.netty.DisposableServer;
|
||||
import reactor.netty.http.Http11SslContextSpec;
|
||||
import reactor.netty.tcp.SslProvider.GenericSslContextSpec;
|
||||
|
||||
import org.springframework.http.server.reactive.ReactorHttpHandlerAdapter;
|
||||
|
||||
@@ -40,7 +42,8 @@ public class ReactorHttpsServer extends AbstractHttpServer {
|
||||
@Override
|
||||
protected void initServer() throws Exception {
|
||||
SelfSignedCertificate cert = new SelfSignedCertificate();
|
||||
Http11SslContextSpec http11SslContextSpec = Http11SslContextSpec.forServer(cert.certificate(), cert.privateKey());
|
||||
GenericSslContextSpec<SslContextBuilder> http11SslContextSpec =
|
||||
Http11SslContextSpec.forServer(cert.certificate(), cert.privateKey());
|
||||
|
||||
this.reactorHandler = createHttpHandlerAdapter();
|
||||
this.reactorServer = reactor.netty.http.server.HttpServer.create()
|
||||
|
||||
Reference in New Issue
Block a user