use of org.springframework.data.mapping.context.SampleMappingContext in project spring-data-commons by spring-projects.
the class MappingContextTypeInformationMapperUnitTests method detectsTypeForUnknownEntity.
@Test
public void detectsTypeForUnknownEntity() {
SampleMappingContext mappingContext = new SampleMappingContext();
mappingContext.initialize();
mapper = new MappingContextTypeInformationMapper(mappingContext);
assertThat(mapper.resolveTypeFrom(Alias.of("foo"))).isNull();
PersistentEntity<?, SamplePersistentProperty> entity = mappingContext.getRequiredPersistentEntity(Entity.class);
assertThat(entity).isNotNull();
assertThat(mapper.resolveTypeFrom(Alias.of("foo"))).isEqualTo(from(Entity.class));
}
Aggregations