use of org.molgenis.data.util.GenericDependencyResolver in project molgenis by molgenis.
the class AbstractMolgenisSpringTest method abstractMolgenisSpringTestBeforeClass.
// long method name, because if a method annotated with @BeforeClass and the same method name exists in a subclass then this method is ignored.
@BeforeClass
public void abstractMolgenisSpringTestBeforeClass() {
// bootstrap meta data
EntityTypeMetadata entityTypeMeta = applicationContext.getBean(EntityTypeMetadata.class);
entityTypeMeta.setBackendEnumOptions(newArrayList("test"));
applicationContext.getBean(AttributeMetadata.class).bootstrap(entityTypeMeta);
Map<String, SystemEntityType> systemEntityTypeMap = applicationContext.getBeansOfType(SystemEntityType.class);
new GenericDependencyResolver().resolve(systemEntityTypeMap.values(), SystemEntityType::getDependencies).forEach(systemEntityType -> systemEntityType.bootstrap(entityTypeMeta));
}
use of org.molgenis.data.util.GenericDependencyResolver in project molgenis by molgenis.
the class EntityTypeDependencyResolverTest method setUpBeforeMethod.
@BeforeMethod
public void setUpBeforeMethod() {
// do not mock generic dependency resolver to simplify test writing
GenericDependencyResolver genericDependencyResolver = new GenericDependencyResolver();
entityTypeDependencyResolver = new EntityTypeDependencyResolver(genericDependencyResolver);
entityType0 = when(mock(EntityType.class).getId()).thenReturn("entity0").getMock();
entityType1 = when(mock(EntityType.class).getId()).thenReturn("entity1").getMock();
entityType2 = when(mock(EntityType.class).getId()).thenReturn("entity2").getMock();
entityType3 = when(mock(EntityType.class).getId()).thenReturn("entity3").getMock();
attr0 = when(mock(Attribute.class).getName()).thenReturn("attr0").getMock();
attr1 = when(mock(Attribute.class).getName()).thenReturn("attr1").getMock();
attr2 = when(mock(Attribute.class).getName()).thenReturn("attr2").getMock();
attr3 = when(mock(Attribute.class).getName()).thenReturn("attr3").getMock();
when(entityType0.getOwnAllAttributes()).thenReturn(singleton(attr0));
when(entityType1.getOwnAllAttributes()).thenReturn(singleton(attr1));
when(entityType2.getOwnAllAttributes()).thenReturn(singleton(attr2));
when(entityType3.getOwnAllAttributes()).thenReturn(singleton(attr3));
}
Aggregations