use of org.apache.atlas.model.typedef.AtlasEnumDef in project incubator-atlas by apache.
the class AtlasTypeDefGraphStoreTest method testCreateWithValidSuperTypes.
@Test(dependsOnMethods = "testGet")
public void testCreateWithValidSuperTypes() {
// Test Classification with supertype
List<AtlasClassificationDef> classificationDefs = TestUtilsV2.getClassificationWithValidSuperType();
AtlasTypesDef toCreate = new AtlasTypesDef(Collections.<AtlasEnumDef>emptyList(), Collections.<AtlasStructDef>emptyList(), classificationDefs, Collections.<AtlasEntityDef>emptyList());
try {
AtlasTypesDef created = typeDefStore.createTypesDef(toCreate);
assertEquals(created.getClassificationDefs(), toCreate.getClassificationDefs(), "Classification creation with valid supertype should've succeeded");
} catch (AtlasBaseException e) {
fail("Classification creation with valid supertype should've succeeded");
}
// Test Entity with supertype
List<AtlasEntityDef> entityDefs = TestUtilsV2.getEntityWithValidSuperType();
toCreate = new AtlasTypesDef(Collections.<AtlasEnumDef>emptyList(), Collections.<AtlasStructDef>emptyList(), Collections.<AtlasClassificationDef>emptyList(), entityDefs);
try {
AtlasTypesDef created = typeDefStore.createTypesDef(toCreate);
assertEquals(created.getEntityDefs(), toCreate.getEntityDefs(), "Entity creation with valid supertype should've succeeded");
} catch (AtlasBaseException e) {
fail("Entity creation with valid supertype should've succeeded");
}
}
Aggregations