Clean up warnings in spring-messaging
This commit is contained in:
@@ -22,7 +22,6 @@ import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.MessageHeaders;
|
||||
@@ -42,13 +41,7 @@ import static org.junit.Assert.*;
|
||||
*/
|
||||
public class MessageConverterTests {
|
||||
|
||||
private TestMessageConverter converter;
|
||||
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
this.converter = new TestMessageConverter();
|
||||
}
|
||||
private TestMessageConverter converter = new TestMessageConverter();
|
||||
|
||||
@Test
|
||||
public void supportsTargetClass() {
|
||||
@@ -105,7 +98,6 @@ public class MessageConverterTests {
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void setStrictContentTypeMatchWithNoSupportedMimeTypes() {
|
||||
Message<String> message = MessageBuilder.withPayload("ABC").build();
|
||||
this.converter = new TestMessageConverter(Collections.<MimeType>emptyList());
|
||||
this.converter.setStrictContentTypeMatch(true);
|
||||
}
|
||||
|
||||
@@ -130,6 +130,7 @@ public class MethodMessageHandlerTests {
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private static class TestController {
|
||||
|
||||
public String method;
|
||||
@@ -140,6 +141,7 @@ public class MethodMessageHandlerTests {
|
||||
this.method = "pathMatchWildcard";
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public void handlerArgumentResolver(Message message) {
|
||||
this.method = "handlerArgumentResolver";
|
||||
this.arguments.put("message", message);
|
||||
@@ -164,6 +166,7 @@ public class MethodMessageHandlerTests {
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private static class DuplicateMappingsController {
|
||||
|
||||
public void handlerFoo() { }
|
||||
|
||||
@@ -39,6 +39,7 @@ public class SimpSessionScopeTests {
|
||||
|
||||
private SimpSessionScope scope;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private ObjectFactory objectFactory;
|
||||
|
||||
private SimpAttributes simpAttributes;
|
||||
|
||||
@@ -78,7 +78,6 @@ public class SendToMethodReturnValueHandlerTests {
|
||||
|
||||
|
||||
@Before
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public void setup() throws Exception {
|
||||
|
||||
MockitoAnnotations.initMocks(this);
|
||||
|
||||
@@ -87,6 +87,7 @@ public class SimpAnnotationMethodMessageHandlerTests {
|
||||
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void headerArgumentResolution() {
|
||||
SimpMessageHeaderAccessor headers = SimpMessageHeaderAccessor.create();
|
||||
headers.setSessionId("session1");
|
||||
|
||||
@@ -124,8 +124,8 @@ public class SubscriptionMethodReturnValueHandlerTests {
|
||||
assertEquals(MIME_TYPE, headerAccessor.getContentType());
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public void testHeadersPassedToMessagingTemplate() throws Exception {
|
||||
|
||||
String sessionId = "sess1";
|
||||
|
||||
@@ -32,7 +32,6 @@ import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.junit.rules.TestName;
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
import org.springframework.context.ApplicationEventPublisher;
|
||||
@@ -386,6 +385,8 @@ public class StompBrokerRelayMessageHandlerIntegrationTests {
|
||||
return builder;
|
||||
}
|
||||
|
||||
// TODO Determine why connectWithError() is unused.
|
||||
@SuppressWarnings("unused")
|
||||
public static MessageExchangeBuilder connectWithError(String sessionId) {
|
||||
StompHeaderAccessor headers = StompHeaderAccessor.create(StompCommand.CONNECT);
|
||||
headers.setSessionId(sessionId);
|
||||
|
||||
@@ -225,6 +225,8 @@ public class ExecutorSubscribableChannelTests {
|
||||
this.messageToReturn = messageToReturn;
|
||||
}
|
||||
|
||||
// TODO Determine why setExceptionToRaise() is unused.
|
||||
@SuppressWarnings("unused")
|
||||
public void setExceptionToRaise(RuntimeException exception) {
|
||||
this.exceptionToRaise = exception;
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ public class MessageBuilderTests {
|
||||
@Test
|
||||
public void testBuildMultipleMessages() {
|
||||
MessageHeaderAccessor headerAccessor = new MessageHeaderAccessor();
|
||||
MessageBuilder messageBuilder = MessageBuilder.withPayload("payload").setHeaders(headerAccessor);
|
||||
MessageBuilder<?> messageBuilder = MessageBuilder.withPayload("payload").setHeaders(headerAccessor);
|
||||
|
||||
headerAccessor.setHeader("foo", "bar1");
|
||||
Message<?> message1 = messageBuilder.build();
|
||||
|
||||
@@ -85,7 +85,6 @@ public class NativeMessageHeaderAccessorTests {
|
||||
Map<String, Object> actual = headerAccessor.toMap();
|
||||
assertEquals(0, actual.size());
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, List<String>> actualNativeHeaders = headerAccessor.toNativeHeaderMap();
|
||||
assertEquals(Collections.emptyMap(), actualNativeHeaders);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user