Spring cleaning: use diamond operator

This commit is contained in:
Sam Brannen
2024-02-23 11:52:17 +01:00
parent 233b59f144
commit 4339c8eac2
18 changed files with 25 additions and 25 deletions

View File

@@ -77,7 +77,7 @@ class DestinationResolvingMessagingTemplateTests {
void sendNoDestinationResolver() {
TestDestinationResolvingMessagingTemplate template = new TestDestinationResolvingMessagingTemplate();
assertThatIllegalStateException().isThrownBy(() ->
template.send("myChannel", new GenericMessage<Object>("payload")));
template.send("myChannel", new GenericMessage<>("payload")));
}
@Test

View File

@@ -67,7 +67,7 @@ class MessageRequestReplyTemplateTests {
@Test
void sendAndReceiveMissingDestination() {
assertThatIllegalStateException().isThrownBy(() ->
this.template.sendAndReceive(new GenericMessage<Object>("request")));
this.template.sendAndReceive(new GenericMessage<>("request")));
}
@Test

View File

@@ -103,7 +103,7 @@ class SimpAttributesContextHolderTests {
@Test
void setAttributesFromMessageWithMissingSessionId() {
assertThatIllegalStateException().isThrownBy(() ->
SimpAttributesContextHolder.setAttributesFromMessage(new GenericMessage<Object>("")))
SimpAttributesContextHolder.setAttributesFromMessage(new GenericMessage<>("")))
.withMessageStartingWith("No session id in");
}

View File

@@ -111,7 +111,7 @@ class SimpMessagingTemplateTests {
void convertAndSendWithCustomHeaderNonNative() {
Map<String, Object> headers = new HashMap<>();
headers.put("key", "value");
headers.put(NativeMessageHeaderAccessor.NATIVE_HEADERS, new LinkedMultiValueMap<String, String>());
headers.put(NativeMessageHeaderAccessor.NATIVE_HEADERS, new LinkedMultiValueMap<>());
this.messagingTemplate.convertAndSend("/foo", "data", headers);
List<Message<byte[]>> messages = this.messageChannel.getMessages();

View File

@@ -69,7 +69,7 @@ class BrokerMessageHandlerTests {
@Test
void handleMessageWhenBrokerNotRunning() {
this.handler.handleMessage(new GenericMessage<Object>("payload"));
this.handler.handleMessage(new GenericMessage<>("payload"));
assertThat(this.handler.messages).isEqualTo(Collections.emptyList());
}