Search in sources :

Example 1 with AnnotatedTypeScanner

use of org.springframework.data.util.AnnotatedTypeScanner in project spring-data-commons by spring-projects.

the class TypeAliasUnitTests method scanningforAtPersistentFindsTypeAliasAnnotatedTypes.

// DATACMNS-547
@Test
@SuppressWarnings("unchecked")
public void scanningforAtPersistentFindsTypeAliasAnnotatedTypes() {
    AnnotatedTypeScanner scanner = new AnnotatedTypeScanner(Persistent.class);
    Set<Class<?>> types = scanner.findTypes(getClass().getPackage().getName());
    assertThat(types).containsExactlyInAnyOrder(SampleType.class, TypeAlias.class);
}
Also used : AnnotatedTypeScanner(org.springframework.data.util.AnnotatedTypeScanner) Test(org.junit.Test)

Example 2 with AnnotatedTypeScanner

use of org.springframework.data.util.AnnotatedTypeScanner in project spring-data-commons by spring-projects.

the class MappingContextTypeInformationMapperUnitTests method createsTypeMapperForGenericTypesWithDifferentBindings.

// DATACMNS-485
@Test
@SuppressWarnings("unchecked")
public void createsTypeMapperForGenericTypesWithDifferentBindings() {
    AnnotatedTypeScanner scanner = new AnnotatedTypeScanner(TypeAlias.class);
    SampleMappingContext context = new SampleMappingContext();
    context.setInitialEntitySet(scanner.findTypes(getClass().getPackage().getName()));
    context.initialize();
    new MappingContextTypeInformationMapper(context);
}
Also used : AnnotatedTypeScanner(org.springframework.data.util.AnnotatedTypeScanner) SampleMappingContext(org.springframework.data.mapping.context.SampleMappingContext) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 AnnotatedTypeScanner (org.springframework.data.util.AnnotatedTypeScanner)2 SampleMappingContext (org.springframework.data.mapping.context.SampleMappingContext)1