@Test public void testDefaultValueForPrimitiveTypes() throws Exception { init(); EntityMutationResponse response = entityStore.createOrUpdate(new AtlasEntityStream(primitiveEntity), false); List<AtlasEntityHeader> entitiesCreatedResponse = response.getEntitiesByOperation(EntityOperation.CREATE); List<AtlasEntityHeader> entitiesCreatedwithdefault = response.getMutatedEntities().get(EntityOperation.CREATE); AtlasEntity entityCreated = getEntityFromStore(entitiesCreatedResponse.get(0)); Map attributesMap = entityCreated.getAttributes(); String description = (String) attributesMap.get("description"); String check = (String) attributesMap.get("check"); String sourceCode = (String) attributesMap.get("sourcecode"); float diskUsage = (float) attributesMap.get("diskUsage"); boolean isstoreUse = (boolean) attributesMap.get("isstoreUse"); int cost = (int) attributesMap.get("Cost"); assertEquals(description,"test"); assertEquals(check,"check"); //defaultValue assertEquals(diskUsage,70.5f); assertEquals(isstoreUse,true); assertEquals(sourceCode,"Hello World"); assertEquals(cost,30); }
Map<EntityOperation, List<AtlasEntityHeader>> mutatedEntities = reponse.getMutatedEntities(); Map<String, String> guidAssignments = reponse.getGuidAssignments();
@Test public void testDefaultValueForPrimitiveTypes() throws Exception { init(); EntityMutationResponse response = entityStore.createOrUpdate(new AtlasEntityStream(primitiveEntity), false); List<AtlasEntityHeader> entitiesCreatedResponse = response.getEntitiesByOperation(EntityOperation.CREATE); List<AtlasEntityHeader> entitiesCreatedwithdefault = response.getMutatedEntities().get(EntityOperation.CREATE); AtlasEntity entityCreated = getEntityFromStore(entitiesCreatedResponse.get(0)); Map attributesMap = entityCreated.getAttributes(); String description = (String) attributesMap.get("description"); String check = (String) attributesMap.get("check"); String sourceCode = (String) attributesMap.get("sourcecode"); float diskUsage = (float) attributesMap.get("diskUsage"); boolean isstoreUse = (boolean) attributesMap.get("isstoreUse"); int cost = (int) attributesMap.get("Cost"); assertEquals(description,"test"); assertEquals(check,"check"); //defaultValue assertEquals(diskUsage,70.5f); assertEquals(isstoreUse,true); assertEquals(sourceCode,"Hello World"); assertEquals(cost,30); }
Map<EntityOperation, List<AtlasEntityHeader>> mutatedEntities = reponse.getMutatedEntities(); Map<String, String> guidAssignments = reponse.getGuidAssignments();
validateEntity(deptEntity, getEntityFromStore(dept1), deptEntity.getEntities().get(0)); final Map<EntityOperation, List<AtlasEntityHeader>> entitiesMutated = response.getMutatedEntities(); List<AtlasEntityHeader> entitiesCreated = entitiesMutated.get(EntityOperation.CREATE);
validateEntity(deptEntity, getEntityFromStore(dept1), deptEntity.getEntities().get(0)); final Map<EntityOperation, List<AtlasEntityHeader>> entitiesMutated = response.getMutatedEntities(); List<AtlasEntityHeader> entitiesCreated = entitiesMutated.get(EntityOperation.CREATE);