diff --git a/spring-jms/src/main/java/org/springframework/jms/listener/DefaultMessageListenerContainer.java b/spring-jms/src/main/java/org/springframework/jms/listener/DefaultMessageListenerContainer.java index cde9a64af81..856be8c914d 100644 --- a/spring-jms/src/main/java/org/springframework/jms/listener/DefaultMessageListenerContainer.java +++ b/spring-jms/src/main/java/org/springframework/jms/listener/DefaultMessageListenerContainer.java @@ -1008,11 +1008,8 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe } } if (!applyBackOffTime(execution)) { - StringBuilder msg = new StringBuilder(); - msg.append("Stopping container for destination '") - .append(getDestinationDescription()) - .append("': back-off policy does not allow ").append("for further attempts."); - logger.error(msg.toString()); + logger.error("Stopping container for destination '" + getDestinationDescription() + + "': back-off policy does not allow for further attempts."); stop(); } } diff --git a/spring-jms/src/test/java/org/springframework/jms/config/JmsNamespaceHandlerTests.java b/spring-jms/src/test/java/org/springframework/jms/config/JmsNamespaceHandlerTests.java index 8755e944b2e..4e3934320d6 100644 --- a/spring-jms/src/test/java/org/springframework/jms/config/JmsNamespaceHandlerTests.java +++ b/spring-jms/src/test/java/org/springframework/jms/config/JmsNamespaceHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2021 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. @@ -69,12 +69,12 @@ public class JmsNamespaceHandlerTests { @BeforeEach - public void setUp() throws Exception { + public void setup() { this.context = new ToolingTestApplicationContext("jmsNamespaceHandlerTests.xml", getClass()); } @AfterEach - public void tearDown() throws Exception { + public void shutdown() { this.context.close(); } diff --git a/spring-jms/src/test/java/org/springframework/jms/listener/SimpleMessageListenerContainerTests.java b/spring-jms/src/test/java/org/springframework/jms/listener/SimpleMessageListenerContainerTests.java index ae9e9c64fb3..76bd754e2cc 100644 --- a/spring-jms/src/test/java/org/springframework/jms/listener/SimpleMessageListenerContainerTests.java +++ b/spring-jms/src/test/java/org/springframework/jms/listener/SimpleMessageListenerContainerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2021 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. @@ -75,8 +75,7 @@ public class SimpleMessageListenerContainerTests { @Test public void testSessionTransactedModeReallyDoesDefaultToFalse() { assertThat(this.container.isPubSubNoLocal()).as("The [pubSubLocal] property of SimpleMessageListenerContainer " + - "must default to false. Change this test (and the " + - "attendant Javadoc) if you have changed the default.").isFalse(); + "must default to false. Change this test (and the attendant javadoc) if you have changed the default.").isFalse(); } @Test diff --git a/spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/ReactorNettyTcpStompClientTests.java b/spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/ReactorNettyTcpStompClientTests.java index 4bf79b57d2d..90985f35d79 100644 --- a/spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/ReactorNettyTcpStompClientTests.java +++ b/spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/ReactorNettyTcpStompClientTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2021 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. @@ -58,7 +58,7 @@ public class ReactorNettyTcpStompClientTests { @BeforeEach - public void setUp(TestInfo testInfo) throws Exception { + public void setup(TestInfo testInfo) throws Exception { logger.debug("Setting up before '" + testInfo.getTestMethod().get().getName() + "'"); int port = SocketUtils.findAvailableTcpPort(61613); @@ -81,7 +81,7 @@ public class ReactorNettyTcpStompClientTests { } @AfterEach - public void tearDown() throws Exception { + public void shutdown() throws Exception { try { this.client.shutdown(); } diff --git a/spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/StompBrokerRelayMessageHandlerIntegrationTests.java b/spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/StompBrokerRelayMessageHandlerIntegrationTests.java index 68753f79e80..c3c0d029346 100644 --- a/spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/StompBrokerRelayMessageHandlerIntegrationTests.java +++ b/spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/StompBrokerRelayMessageHandlerIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2021 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. @@ -75,7 +75,7 @@ public class StompBrokerRelayMessageHandlerIntegrationTests { @BeforeEach - public void setUp(TestInfo testInfo) throws Exception { + public void setup(TestInfo testInfo) throws Exception { logger.debug("Setting up before '" + testInfo.getTestMethod().get().getName() + "'"); this.port = SocketUtils.findAvailableTcpPort(61613); @@ -83,11 +83,11 @@ public class StompBrokerRelayMessageHandlerIntegrationTests { this.responseHandler = new TestMessageHandler(); this.responseChannel.subscribe(this.responseHandler); this.eventPublisher = new TestEventPublisher(); - startActiveMqBroker(); + startActiveMQBroker(); createAndStartRelay(); } - private void startActiveMqBroker() throws Exception { + private void startActiveMQBroker() throws Exception { this.activeMQBroker = new BrokerService(); this.activeMQBroker.addConnector("stomp://localhost:" + this.port); this.activeMQBroker.setStartAsync(false); @@ -217,7 +217,7 @@ public class StompBrokerRelayMessageHandlerIntegrationTests { this.eventPublisher.expectBrokerAvailabilityEvent(false); - startActiveMqBroker(); + startActiveMQBroker(); this.eventPublisher.expectBrokerAvailabilityEvent(true); }