List of usage examples for org.springframework.data.rest.core Path Path
public Path(String path)
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); }
From source file:org.moserp.common.json_schema.JsonSchemaBuilderTest.java
public void setupMocks() throws URISyntaxException { configuration = mock(RepositoryRestConfiguration.class); when(configuration.getBaseUri()).thenReturn(new URI("http://localhost:8080/")); mappings = mock(ResourceMappings.class); metaData = mock(ResourceMetadata.class); when(metaData.getPath()).thenReturn(new Path("valueLists")); PersistentEntity persistentEntity = mock(PersistentEntity.class); when(persistentEntities.getPersistentEntity(any())).thenReturn(persistentEntity); PersistentProperty persistentProperty = mock(PersistentProperty.class); when(persistentEntity.getPersistentProperty(any(String.class))).thenReturn(persistentProperty); when(entityLinks.linkFor(any())).thenReturn(BaseUriLinkBuilder.create(new URI("http://localhost:8080/"))); moduleRegistry = mock(ModuleRegistry.class); when(moduleRegistry.getBaseUriForResource(anyString())) .thenReturn(new RestUri("http://localhost:8080/valueLists")); }