use of org.apache.ranger.tagsync.source.atlasrest.RangerAtlasEntity in project ranger by apache.
the class TestHiveResourceMapper method testHiveColumn.
@Test
public void testHiveColumn() throws Exception {
Map<String, Object> entAttribs = new HashMap<String, Object>();
entAttribs.put(AtlasHiveResourceMapper.ENTITY_ATTRIBUTE_QUALIFIED_NAME, COLUMN_QUALIFIED_NAME);
RangerAtlasEntity entity = getHiveColumnEntity(entAttribs);
RangerServiceResource resource = resourceMapper.buildResource(entity);
assertColumnResource(resource);
}
use of org.apache.ranger.tagsync.source.atlasrest.RangerAtlasEntity in project ranger by apache.
the class TestHiveResourceMapper method testHiveDb.
@Test
public void testHiveDb() throws Exception {
Map<String, Object> entAttribs = new HashMap<String, Object>();
entAttribs.put(AtlasHiveResourceMapper.ENTITY_ATTRIBUTE_QUALIFIED_NAME, DB_QUALIFIED_NAME);
RangerAtlasEntity entity = getHiveDbEntity(entAttribs);
RangerServiceResource resource = resourceMapper.buildResource(entity);
assertDbResource(resource);
}
use of org.apache.ranger.tagsync.source.atlasrest.RangerAtlasEntity in project ranger by apache.
the class TestHiveResourceMapper method getHiveTableEntity.
private RangerAtlasEntity getHiveTableEntity(Map<String, Object> entAttribs) throws Exception {
RangerAtlasEntity entity = Mockito.mock(RangerAtlasEntity.class);
Mockito.when(entity.getTypeName()).thenReturn(AtlasHiveResourceMapper.ENTITY_TYPE_HIVE_TABLE);
Mockito.when(entity.getAttributes()).thenReturn(entAttribs);
return entity;
}
use of org.apache.ranger.tagsync.source.atlasrest.RangerAtlasEntity in project ranger by apache.
the class TestKafkaResourceMapper method testKafkaResourceFromMissingAttribs.
@Test
public void testKafkaResourceFromMissingAttribs() throws Exception {
Map<String, Object> entAttribs = new HashMap<String, Object>();
RangerAtlasEntity entity = getKafkaTopicEntity(entAttribs);
try {
RangerServiceResource resource = resourceMapper.buildResource(entity);
Assert.fail("expected exception. Found " + resource);
} catch (Exception excp) {
// ignore
}
}
use of org.apache.ranger.tagsync.source.atlasrest.RangerAtlasEntity in project ranger by apache.
the class TestKafkaResourceMapper method getKafkaTopicEntity.
private RangerAtlasEntity getKafkaTopicEntity(Map<String, Object> entAttribs) throws Exception {
RangerAtlasEntity entity = Mockito.mock(RangerAtlasEntity.class);
Mockito.when(entity.getTypeName()).thenReturn(AtlasKafkaResourceMapper.ENTITY_TYPE_KAFKA_TOPIC);
Mockito.when(entity.getAttributes()).thenReturn(entAttribs);
return entity;
}
Aggregations