DATACMNS-1780 - Polishing.

Consistently use MappingException when a required PersistentEntity cannot be obtained.
This commit is contained in:
Mark Paluch
2020-08-04 15:25:34 +02:00
parent 2aae23763b
commit 7b26fd199f
2 changed files with 9 additions and 4 deletions

View File

@@ -27,6 +27,7 @@ import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.Reference;
import org.springframework.data.mapping.MappingException;
import org.springframework.data.mapping.PersistentEntity;
import org.springframework.data.mapping.model.BasicPersistentEntity;
import org.springframework.data.util.ClassTypeInformation;
@@ -36,6 +37,7 @@ import org.springframework.data.util.ClassTypeInformation;
*
* @author Oliver Gierke
* @author Christoph Strobl
* @author Mar Paluch
*/
@ExtendWith(MockitoExtension.class)
class PersistentEntitiesUnitTests {
@@ -157,7 +159,7 @@ class PersistentEntitiesUnitTests {
@Test // DATACMNS-1780
void getRequiredPersistentEntityErrorsOnInFlightEntityCreationForUnknownTypesWhenHavingMultipleMappingContexts() {
assertThatExceptionOfType(IllegalArgumentException.class)
assertThatExceptionOfType(MappingException.class)
.isThrownBy(() -> PersistentEntities.of(first, second).getRequiredPersistentEntity(Sample.class));
}