MessageListenerContainer must not be initialized twice.

Error when afterPropertiesSet is called more than once. Update documentation and error messages.
Original Pull Request: #2256
This commit is contained in:
Christoph Strobl
2022-02-17 11:12:48 +01:00
parent 5681ddce68
commit f6b21315a7
2 changed files with 87 additions and 76 deletions

View File

@@ -105,4 +105,9 @@ class RedisMessageListenerContainerUnitTests {
assertThat(container.isRunning()).isFalse();
verify(subscriptionMock).close();
}
@Test // GH-964
void failsOnDuplicateInit() {
assertThatExceptionOfType(IllegalStateException.class).isThrownBy(() -> container.afterPropertiesSet());
}
}