Skip to content

Commit 1153969

Browse files
committed
Polish
1 parent 1182489 commit 1153969

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompDecoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/StompCodecTests.java

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -176,18 +176,15 @@ public void decodeMultipleFramesFromSameBuffer() {
176176
Buffer buffer = Buffer.wrap(frame1 + frame2);
177177

178178
final List<Message<byte[]>> messages = new ArrayList<Message<byte[]>>();
179-
new Reactor2StompCodec().decoder(new Consumer<Message<byte[]>>() {
180-
@Override
181-
public void accept(Message<byte[]> message) {
182-
messages.add(message);
183-
}
184-
}).apply(buffer);
179+
new Reactor2StompCodec().decoder(messages::add).apply(buffer);
185180

186181
assertEquals(2, messages.size());
187182
assertEquals(StompCommand.SEND, StompHeaderAccessor.wrap(messages.get(0)).getCommand());
188183
assertEquals(StompCommand.DISCONNECT, StompHeaderAccessor.wrap(messages.get(1)).getCommand());
189184
}
190185

186+
// SPR-13111
187+
191188
@Test
192189
public void decodeFrameWithHeaderWithEmptyValue() {
193190
String accept = "accept-version:1.1\n";
@@ -251,12 +248,7 @@ public void decodeHeartbeat() {
251248
Buffer buffer = Buffer.wrap(frame);
252249

253250
final List<Message<byte[]>> messages = new ArrayList<Message<byte[]>>();
254-
new Reactor2StompCodec().decoder(new Consumer<Message<byte[]>>() {
255-
@Override
256-
public void accept(Message<byte[]> message) {
257-
messages.add(message);
258-
}
259-
}).apply(buffer);
251+
new Reactor2StompCodec().decoder(messages::add).apply(buffer);
260252

261253
assertEquals(1, messages.size());
262254
assertEquals(SimpMessageType.HEARTBEAT, StompHeaderAccessor.wrap(messages.get(0)).getMessageType());

0 commit comments

Comments
 (0)