Search in sources :

Example 1 with RepositoryCapability

use of org.molgenis.data.RepositoryCapability in project molgenis by molgenis.

the class AbstractRepositoryTest method beforeTest.

@BeforeTest
public void beforeTest() {
    MockitoAnnotations.initMocks(this);
    Attribute idAttr = when(mock(Attribute.class).getName()).thenReturn("id").getMock();
    entityType = when(mock(EntityType.class).getId()).thenReturn("entity").getMock();
    when(entityType.getIdAttribute()).thenReturn(idAttr);
    abstractRepository = Mockito.spy(new AbstractRepository() {

        @Override
        public Iterator<Entity> iterator() {
            return null;
        }

        public EntityType getEntityType() {
            return entityType;
        }

        @Override
        public Set<RepositoryCapability> getCapabilities() {
            return Collections.emptySet();
        }
    });
}
Also used : EntityType(org.molgenis.data.meta.model.EntityType) Entity(org.molgenis.data.Entity) Attribute(org.molgenis.data.meta.model.Attribute) RepositoryCapability(org.molgenis.data.RepositoryCapability) BeforeTest(org.testng.annotations.BeforeTest)

Aggregations

Entity (org.molgenis.data.Entity)1 RepositoryCapability (org.molgenis.data.RepositoryCapability)1 Attribute (org.molgenis.data.meta.model.Attribute)1 EntityType (org.molgenis.data.meta.model.EntityType)1 BeforeTest (org.testng.annotations.BeforeTest)1