Use AssertJ's hasSize() for collections and maps

Achieved via a global search-and-replace.
This commit is contained in:
Sam Brannen
2022-11-22 16:50:10 +01:00
parent f9f8f2d89e
commit 36f7597f25
237 changed files with 1161 additions and 1172 deletions

View File

@@ -107,7 +107,7 @@ public class AnnotationTransactionNamespaceHandlerTests {
public void transactionalEventListenerRegisteredProperly() {
assertThat(this.context.containsBean(TransactionManagementConfigUtils
.TRANSACTIONAL_EVENT_LISTENER_FACTORY_BEAN_NAME)).isTrue();
assertThat(this.context.getBeansOfType(TransactionalEventListenerFactory.class).size()).isEqualTo(1);
assertThat(this.context.getBeansOfType(TransactionalEventListenerFactory.class)).hasSize(1);
}
private TransactionalTestBean getTestBean() {

View File

@@ -216,7 +216,7 @@ public class EnableTransactionManagementTests {
public void transactionalEventListenerRegisteredProperly() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(EnableTxConfig.class);
assertThat(ctx.containsBean(TransactionManagementConfigUtils.TRANSACTIONAL_EVENT_LISTENER_FACTORY_BEAN_NAME)).isTrue();
assertThat(ctx.getBeansOfType(TransactionalEventListenerFactory.class).size()).isEqualTo(1);
assertThat(ctx.getBeansOfType(TransactionalEventListenerFactory.class)).hasSize(1);
ctx.close();
}