Browse Source

Clean up warnings in Gradle build

pull/25585/head
Sam Brannen 6 years ago
parent
commit
4d3dd9b9f6
  1. 32
      spring-web/src/test/java/org/springframework/remoting/httpinvoker/HttpInvokerFactoryBeanIntegrationTests.java
  2. 5
      spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/SseIntegrationTests.java
  3. 9
      spring-webflux/src/test/java/org/springframework/web/reactive/socket/WebSocketIntegrationTests.java

32
spring-web/src/test/java/org/springframework/remoting/httpinvoker/HttpInvokerFactoryBeanIntegrationTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2020 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.
@ -38,11 +38,11 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -38,11 +38,11 @@ import static org.assertj.core.api.Assertions.assertThat;
/**
* @author Stephane Nicoll
*/
public class HttpInvokerFactoryBeanIntegrationTests {
class HttpInvokerFactoryBeanIntegrationTests {
@Test
@SuppressWarnings("resource")
public void testLoadedConfigClass() {
void testLoadedConfigClass() {
ApplicationContext context = new AnnotationConfigApplicationContext(InvokerAutowiringConfig.class);
MyBean myBean = context.getBean("myBean", MyBean.class);
assertThat(myBean.myService).isSameAs(context.getBean("myService"));
@ -52,7 +52,7 @@ public class HttpInvokerFactoryBeanIntegrationTests { @@ -52,7 +52,7 @@ public class HttpInvokerFactoryBeanIntegrationTests {
@Test
@SuppressWarnings("resource")
public void testNonLoadedConfigClass() {
void testNonLoadedConfigClass() {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
context.registerBeanDefinition("config", new RootBeanDefinition(InvokerAutowiringConfig.class.getName()));
context.refresh();
@ -64,7 +64,7 @@ public class HttpInvokerFactoryBeanIntegrationTests { @@ -64,7 +64,7 @@ public class HttpInvokerFactoryBeanIntegrationTests {
@Test
@SuppressWarnings("resource")
public void withConfigurationClassWithPlainFactoryBean() {
void withConfigurationClassWithPlainFactoryBean() {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
context.register(ConfigWithPlainFactoryBean.class);
context.refresh();
@ -75,9 +75,9 @@ public class HttpInvokerFactoryBeanIntegrationTests { @@ -75,9 +75,9 @@ public class HttpInvokerFactoryBeanIntegrationTests {
}
public interface MyService {
interface MyService {
public void handle();
void handle();
@Async
public void handleAsync();
@ -85,25 +85,26 @@ public class HttpInvokerFactoryBeanIntegrationTests { @@ -85,25 +85,26 @@ public class HttpInvokerFactoryBeanIntegrationTests {
@Component("myBean")
public static class MyBean {
static class MyBean {
@Autowired
public MyService myService;
MyService myService;
}
@Configuration
@ComponentScan
@Lazy
public static class InvokerAutowiringConfig {
static class InvokerAutowiringConfig {
@Bean
public AsyncAnnotationBeanPostProcessor aabpp() {
AsyncAnnotationBeanPostProcessor aabpp() {
return new AsyncAnnotationBeanPostProcessor();
}
@Bean
public HttpInvokerProxyFactoryBean myService() {
@SuppressWarnings("deprecation")
HttpInvokerProxyFactoryBean myService() {
HttpInvokerProxyFactoryBean factory = new HttpInvokerProxyFactoryBean();
factory.setServiceUrl("/svc/dummy");
factory.setServiceInterface(MyService.class);
@ -112,7 +113,7 @@ public class HttpInvokerFactoryBeanIntegrationTests { @@ -112,7 +113,7 @@ public class HttpInvokerFactoryBeanIntegrationTests {
}
@Bean
public FactoryBean<String> myOtherService() {
FactoryBean<String> myOtherService() {
throw new IllegalStateException("Don't ever call me");
}
}
@ -125,12 +126,13 @@ public class HttpInvokerFactoryBeanIntegrationTests { @@ -125,12 +126,13 @@ public class HttpInvokerFactoryBeanIntegrationTests {
Environment env;
@Bean
public MyBean myBean() {
MyBean myBean() {
return new MyBean();
}
@Bean
public HttpInvokerProxyFactoryBean myService() {
@SuppressWarnings("deprecation")
HttpInvokerProxyFactoryBean myService() {
String name = env.getProperty("testbean.name");
HttpInvokerProxyFactoryBean factory = new HttpInvokerProxyFactoryBean();
factory.setServiceUrl("/svc/" + name);

5
spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/SseIntegrationTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2020 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.
@ -27,6 +27,7 @@ import org.junit.jupiter.params.ParameterizedTest; @@ -27,6 +27,7 @@ import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
import reactor.core.publisher.Flux;
import reactor.core.publisher.MonoProcessor;
import reactor.core.publisher.Sinks;
import reactor.test.StepVerifier;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
@ -223,7 +224,7 @@ class SseIntegrationTests extends AbstractHttpHandlerIntegrationTests { @@ -223,7 +224,7 @@ class SseIntegrationTests extends AbstractHttpHandlerIntegrationTests {
private static final Flux<Long> INTERVAL = testInterval(Duration.ofMillis(100), 50);
private MonoProcessor<Void> cancellation = MonoProcessor.create();
private MonoProcessor<Void> cancellation = MonoProcessor.fromSink(Sinks.one());
@GetMapping("/string")

9
spring-webflux/src/test/java/org/springframework/web/reactive/socket/WebSocketIntegrationTests.java

@ -28,6 +28,7 @@ import org.apache.commons.logging.LogFactory; @@ -28,6 +28,7 @@ import org.apache.commons.logging.LogFactory;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import reactor.core.publisher.MonoProcessor;
import reactor.core.publisher.Sinks;
import reactor.util.retry.Retry;
import org.springframework.context.annotation.Bean;
@ -98,7 +99,7 @@ class WebSocketIntegrationTests extends AbstractWebSocketIntegrationTests { @@ -98,7 +99,7 @@ class WebSocketIntegrationTests extends AbstractWebSocketIntegrationTests {
String protocol = "echo-v1";
AtomicReference<HandshakeInfo> infoRef = new AtomicReference<>();
MonoProcessor<Object> output = MonoProcessor.create();
MonoProcessor<Object> output = MonoProcessor.fromSink(Sinks.one());
this.client.execute(getUrl("/sub-protocol"),
new WebSocketHandler() {
@ -131,7 +132,7 @@ class WebSocketIntegrationTests extends AbstractWebSocketIntegrationTests { @@ -131,7 +132,7 @@ class WebSocketIntegrationTests extends AbstractWebSocketIntegrationTests {
HttpHeaders headers = new HttpHeaders();
headers.add("my-header", "my-value");
MonoProcessor<Object> output = MonoProcessor.create();
MonoProcessor<Object> output = MonoProcessor.fromSink(Sinks.one());
this.client.execute(getUrl("/custom-header"), headers,
session -> session.receive()
@ -147,7 +148,7 @@ class WebSocketIntegrationTests extends AbstractWebSocketIntegrationTests { @@ -147,7 +148,7 @@ class WebSocketIntegrationTests extends AbstractWebSocketIntegrationTests {
void sessionClosing(WebSocketClient client, HttpServer server, Class<?> serverConfigClass) throws Exception {
startServer(client, server, serverConfigClass);
MonoProcessor<CloseStatus> statusProcessor = MonoProcessor.create();
MonoProcessor<CloseStatus> statusProcessor = MonoProcessor.fromSink(Sinks.one());
this.client.execute(getUrl("/close"),
session -> {
logger.debug("Starting..");
@ -168,7 +169,7 @@ class WebSocketIntegrationTests extends AbstractWebSocketIntegrationTests { @@ -168,7 +169,7 @@ class WebSocketIntegrationTests extends AbstractWebSocketIntegrationTests {
void cookie(WebSocketClient client, HttpServer server, Class<?> serverConfigClass) throws Exception {
startServer(client, server, serverConfigClass);
MonoProcessor<Object> output = MonoProcessor.create();
MonoProcessor<Object> output = MonoProcessor.fromSink(Sinks.one());
AtomicReference<String> cookie = new AtomicReference<>();
this.client.execute(getUrl("/cookie"),
session -> {

Loading…
Cancel
Save