Skip to content

Commit 41fcc42

Browse files
izeyesnicoll
authored andcommitted
Restore persistOfNullThrowsIllegalArgumentExceptionWithoutExceptionTranslation()
See gh-24866
1 parent 7493632 commit 41fcc42

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/dao/PersistenceExceptionTranslationAutoConfigurationTests.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636

3737
import static org.assertj.core.api.Assertions.assertThat;
3838
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
39+
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
3940

4041
/**
4142
* Tests for {@link PersistenceExceptionTranslationAutoConfiguration}
@@ -86,15 +87,12 @@ void exceptionTranslationPostProcessorCanBeDisabled() {
8687
assertThat(beans).isEmpty();
8788
}
8889

89-
// @Test
90-
// public void
91-
// persistOfNullThrowsIllegalArgumentExceptionWithoutExceptionTranslation() {
92-
// this.context = new AnnotationConfigApplicationContext(
93-
// EmbeddedDataSourceConfiguration.class,
94-
// HibernateJpaAutoConfiguration.class, TestConfiguration.class);
95-
// assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(
96-
// () -> this.context.getBean(TestRepository.class).doSomething());
97-
// }
90+
@Test
91+
void persistOfNullThrowsIllegalArgumentExceptionWithoutExceptionTranslation() {
92+
this.context = new AnnotationConfigApplicationContext(EmbeddedDataSourceConfiguration.class,
93+
HibernateJpaAutoConfiguration.class, TestConfiguration.class);
94+
assertThatIllegalArgumentException().isThrownBy(() -> this.context.getBean(TestRepository.class).doSomething());
95+
}
9896

9997
@Test
10098
void persistOfNullThrowsInvalidDataAccessApiUsageExceptionWithExceptionTranslation() {

0 commit comments

Comments
 (0)