DATACMNS-1755 - Use specialized assertThat*Exception.

When possible replace `assertThatExceptionOfType` calls with the
equivalent specialized variant.

Original pull request: #448.
This commit is contained in:
Phillip Webb
2020-06-09 11:29:32 -07:00
committed by Mark Paluch
parent 86bda64daa
commit 5734cfe878
28 changed files with 42 additions and 42 deletions

View File

@@ -96,7 +96,7 @@ class DefaultAuditableBeanWrapperFactoryUnitTests {
assertThat(wrapper).isNotEmpty();
assertThatExceptionOfType(IllegalArgumentException.class)
assertThatIllegalArgumentException()
.isThrownBy(() -> wrapper.ifPresent(it -> it.setLastModifiedDate(zonedDateTime)));
}

View File

@@ -59,7 +59,7 @@ class AuditingBeanDefinitionRegistrarSupportUnitTests {
AuditingBeanDefinitionRegistrarSupport registrar = new DummyAuditingBeanDefinitionRegistrarSupport();
assertThatExceptionOfType(IllegalArgumentException.class) //
assertThatIllegalArgumentException() //
.isThrownBy(() -> registrar.registerBeanDefinitions(null, registry));
}
@@ -69,7 +69,7 @@ class AuditingBeanDefinitionRegistrarSupportUnitTests {
AuditingBeanDefinitionRegistrarSupport registrar = new DummyAuditingBeanDefinitionRegistrarSupport();
AnnotationMetadata metadata = new StandardAnnotationMetadata(SampleConfig.class);
assertThatExceptionOfType(IllegalArgumentException.class) //
assertThatIllegalArgumentException() //
.isThrownBy(() -> registrar.registerBeanDefinitions(metadata, null));
}