use of org.apache.ranger.plugin.model.RangerServiceResource in project ranger by apache.
the class TestHiveResourceMapper method testHiveTable.
@Test
public void testHiveTable() throws Exception {
Map<String, Object> entAttribs = new HashMap<String, Object>();
entAttribs.put(AtlasHiveResourceMapper.ENTITY_ATTRIBUTE_QUALIFIED_NAME, TABLE_QUALIFIED_NAME);
RangerAtlasEntity entity = getHiveTableEntity(entAttribs);
RangerServiceResource resource = resourceMapper.buildResource(entity);
assertTableResource(resource);
}
use of org.apache.ranger.plugin.model.RangerServiceResource in project ranger by apache.
the class TestHiveResourceMapper method testHiveResourceFromMissingAttribs.
@Test
public void testHiveResourceFromMissingAttribs() throws Exception {
Map<String, Object> entAttribs = new HashMap<String, Object>();
RangerAtlasEntity entity = getHiveDbEntity(entAttribs);
try {
RangerServiceResource resource = resourceMapper.buildResource(entity);
Assert.fail("expected exception. Found " + resource);
} catch (Exception excp) {
// ignore
}
}
use of org.apache.ranger.plugin.model.RangerServiceResource in project ranger by apache.
the class TestKafkaResourceMapper method testKafkaResourceFromQualifiedName.
@Test
public void testKafkaResourceFromQualifiedName() throws Exception {
Map<String, Object> entAttribs = new HashMap<String, Object>();
entAttribs.put(AtlasKafkaResourceMapper.ENTITY_ATTRIBUTE_QUALIFIED_NAME, QUALIFIED_NAME);
RangerAtlasEntity entity = getKafkaTopicEntity(entAttribs);
RangerServiceResource resource = resourceMapper.buildResource(entity);
assertServiceResource(resource);
}
use of org.apache.ranger.plugin.model.RangerServiceResource in project ranger by apache.
the class TestKafkaResourceMapper method testKafkaResourceFromOnlyTopic.
@Test
public void testKafkaResourceFromOnlyTopic() throws Exception {
Map<String, Object> entAttribs = new HashMap<String, Object>();
entAttribs.put(AtlasKafkaResourceMapper.ENTITY_ATTRIBUTE_QUALIFIED_NAME, TOPIC);
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.plugin.model.RangerServiceResource in project ranger by apache.
the class TestKafkaResourceMapper method testKafkaResourceFromOnlyClusterName.
@Test
public void testKafkaResourceFromOnlyClusterName() throws Exception {
Map<String, Object> entAttribs = new HashMap<String, Object>();
entAttribs.put(AtlasKafkaResourceMapper.ENTITY_ATTRIBUTE_QUALIFIED_NAME, CLUSTER_NAME);
RangerAtlasEntity entity = getKafkaTopicEntity(entAttribs);
try {
RangerServiceResource resource = resourceMapper.buildResource(entity);
Assert.fail("expected exception. Found " + resource);
} catch (Exception excp) {
// ignore
}
}
Aggregations