List of usage examples for org.springframework.data.rest.core.mapping ResourceMappings getMetadataFor
ResourceMetadata getMetadataFor(Class<?> type);
From source file:org.moserp.common.structure.factories.AssociationPropertyFactoryTest.java
@Before public void setup() { when(persistentProperty.isAssociation()).thenReturn(true); when(persistentProperty.getActualType()).thenReturn((Class) OtherRepositoryClass.class); when(persistentProperty.getType()).thenReturn((Class) OtherRepositoryClass.class); ResourceMappings mappings = mock(ResourceMappings.class); ResourceMetadata metaData = mock(ResourceMetadata.class); when(metaData.getPath()).thenReturn(new Path("otherRepositoryClasses")); when(metaData.isExported()).thenReturn(true); when(mappings.getMetadataFor(eq(OtherRepositoryClass.class))).thenReturn(metaData); ModuleRegistry moduleRegistry = mock(ModuleRegistry.class); when(moduleRegistry.getModuleForResource(anyString())).thenReturn("environment-module"); propertyFactory = new AssociationPropertyFactory(createConfiguration(), mappings, moduleRegistry); }