Skip to content

Commit e0a3b79

Browse files
committed
Merge pull request #24866 from izeye
* pr/24866: Update copyright of changed file Restore persistOfNullThrowsIllegalArgumentExceptionWithoutExceptionTranslation() Closes gh-24866
2 parents 7493632 + 742983f commit e0a3b79

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

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

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -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)