diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/dao/PersistenceExceptionTranslationAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/dao/PersistenceExceptionTranslationAutoConfigurationTests.java index 4ae58190ea2..fd45ae6b115 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/dao/PersistenceExceptionTranslationAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/dao/PersistenceExceptionTranslationAutoConfigurationTests.java @@ -36,6 +36,7 @@ import org.springframework.stereotype.Repository; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; /** * Tests for {@link PersistenceExceptionTranslationAutoConfiguration} @@ -86,15 +87,12 @@ class PersistenceExceptionTranslationAutoConfigurationTests { assertThat(beans).isEmpty(); } - // @Test - // public void - // persistOfNullThrowsIllegalArgumentExceptionWithoutExceptionTranslation() { - // this.context = new AnnotationConfigApplicationContext( - // EmbeddedDataSourceConfiguration.class, - // HibernateJpaAutoConfiguration.class, TestConfiguration.class); - // assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy( - // () -> this.context.getBean(TestRepository.class).doSomething()); - // } + @Test + void persistOfNullThrowsIllegalArgumentExceptionWithoutExceptionTranslation() { + this.context = new AnnotationConfigApplicationContext(EmbeddedDataSourceConfiguration.class, + HibernateJpaAutoConfiguration.class, TestConfiguration.class); + assertThatIllegalArgumentException().isThrownBy(() -> this.context.getBean(TestRepository.class).doSomething()); + } @Test void persistOfNullThrowsInvalidDataAccessApiUsageExceptionWithExceptionTranslation() {