Skip to content

Commit 6a0d882

Browse files
committed
Polishing.
Reformat code, add since tags. Refine test names. See #4403 Original pull request: #4976
1 parent 431fc7f commit 6a0d882

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/DefaultMessageListenerContainer.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.apache.commons.logging.Log;
2727
import org.apache.commons.logging.LogFactory;
2828
import org.jspecify.annotations.Nullable;
29+
2930
import org.springframework.core.task.SimpleAsyncTaskExecutor;
3031
import org.springframework.dao.DataAccessResourceFailureException;
3132
import org.springframework.data.mongodb.core.MongoTemplate;
@@ -112,8 +113,12 @@ public boolean isAutoStartup() {
112113

113114
/**
114115
* Set whether to auto-start this container.
115-
* <p>Default is {@code true}.
116+
* <p>
117+
* Default is {@code true}.
118+
*
116119
* @param autoStartup {@code true} to auto-start.
120+
* @since 5.0
121+
* @see org.springframework.context.SmartLifecycle#isAutoStartup()
117122
*/
118123
public void setAutoStartup(boolean autoStartup) {
119124
this.autoStartup = autoStartup;

spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/messaging/DefaultMessageListenerContainerUnitTests.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,15 @@ void removeSubscriptionWhileRunning() throws Throwable {
8282
}
8383

8484
@Test // GH-4403
85-
void shouldHaveAutoStartupEnabledByDefault() {
85+
void shouldAutoStartup() {
8686
assertThat(container.isAutoStartup()).isTrue();
8787
}
8888

8989
@Test // GH-4403
90-
void shouldAllowDisablingAutoStartup() {
90+
void shouldDisableAutostartup() {
91+
9192
container.setAutoStartup(false);
93+
9294
assertThat(container.isAutoStartup()).isFalse();
9395
}
9496

0 commit comments

Comments
 (0)