Buggy code:
@ RunWith ( Parameterized . class ) public class StompWebSocketIntegrationTests extends AbstractWebSocketIntegrationTests { @ Parameters public static Iterable < Object [ ] > arguments ( ) { } @ Override protected Class < ? > [ ] getAnnotatedConfigClasses ( ) { } @ Test public void sendMessageToController ( ) throws Exception { } @ Test public void sendMessageToControllerAndReceiveReplyViaTopic ( ) throws Exception { } @ Test public void sendMessageToBrokerAndReceiveReplyViaTopic ( ) throws Exception { TextMessage message1 = create ( SUBSCRIBE ) . headers ( "id:subs1" , "destination://topic//foo" ) . build ( ) ; TextMessage message2 = create ( SEND ) . headers ( "destination://topic//foo" ) . body ( "5" ) . build ( ) ; StompWebSocketIntegrationTests . TestClientWebSocketHandler clientHandler = new StompWebSocketIntegrationTests . TestClientWebSocketHandler ( 1 , message1 , message2 ) ; WebSocketSession session = doHandshake ( clientHandler , "//ws" ) . get ( ) ; try { assertTrue ( clientHandler . latch . await ( 2 , TimeUnit . SECONDS ) ) ; String payload = clientHandler . actual . get ( 0 ) . getPayload ( ) ; <START_BUG> assertTrue ( ( "Expected<seq2seq4repair_space>STOMP<seq2seq4repair_space>Command=MESSAGE,<seq2seq4repair_space>got<seq2seq4repair_space>" + payload ) , payload . startsWith ( "MESSAGE\n" ) ) ; <END_BUG> } finally { session . close ( ) ; } } @ Test public void sendSubscribeToControllerAndReceiveReply ( ) throws Exception { } @ StompWebSocketIntegrationTests . IntegrationTestController static class SimpleController { private CountDownLatch latch = new CountDownLatch ( 1 ) ; @ MessageMapping ( "//simple" ) public void handle ( ) { } @ MessageMapping ( "//exception" ) public void handleWithError ( ) { } @ MessageExceptionHandler public void handleException ( IllegalArgumentException ex ) { } } @ StompWebSocketIntegrationTests . IntegrationTestController static class IncrementController { @ MessageMapping ( "//increment" ) public int handle ( int i ) { } @ SubscribeMapping ( "//number" ) public int number ( ) { } } private static class TestClientWebSocketHandler extends TextWebSocketHandler { private final TextMessage [ ] messagesToSend ; private final int expected ; private final List < TextMessage > actual = new CopyOnWriteArrayList < > ( ) ; private final CountDownLatch latch ; public TestClientWebSocketHandler ( int expectedNumberOfMessages , TextMessage ... messagesToSend ) { } @ Override public void afterConnectionEstablished ( WebSocketSession session ) throws Exception { } @ Override protected void handleTextMessage ( WebSocketSession session , TextMessage message ) throws Exception { } } @ Configuration @ ComponentScan ( basePackageClasses = StompWebSocketIntegrationTests . class , useDefaultFilters = false , includeFilters = @ ComponentScan . Filter ( StompWebSocketIntegrationTests . IntegrationTestController . class ) ) static class TestMessageBrokerConfigurer extends AbstractWebSocketMessageBrokerConfigurer { @ Autowired private HandshakeHandler handshakeHandler ; @ Override public void registerStompEndpoints ( StompEndpointRegistry registry ) { } @ Override public void configureMessageBroker ( MessageBrokerRegistry configurer ) { } } @ Configuration static class TestMessageBrokerConfiguration extends DelegatingWebSocketMessageBrokerConfiguration { @ Override @ Bean public AbstractSubscribableChannel clientInboundChannel ( ) { } @ Override @ Bean public AbstractSubscribableChannel clientOutboundChannel ( ) { } } @ Target ( { ElementType . TYPE } ) @ Retention ( RetentionPolicy . RUNTIME ) @ Controller private @ interface IntegrationTestController { } }

Fix:
assertTrue ( ( "Expected<seq2seq4repair_space>STOMP<seq2seq4repair_space>MESSAGE,<seq2seq4repair_space>got<seq2seq4repair_space>" + payload ) , payload . startsWith ( "MESSAGE\n" ) ) ;