use of org.apache.ranger.tagsync.source.atlasrest.RangerAtlasEntity in project ranger by apache.
the class TestHdfsResourceMapper method testHdfsResourceFromClusterNameAndQualifiedName.
@Test
public void testHdfsResourceFromClusterNameAndQualifiedName() throws Exception {
Map<String, Object> entAttribs = new HashMap<String, Object>();
entAttribs.put(AtlasHdfsResourceMapper.ENTITY_ATTRIBUTE_CLUSTER_NAME, CLUSTER_NAME);
entAttribs.put(AtlasHdfsResourceMapper.ENTITY_ATTRIBUTE_QUALIFIED_NAME, QUALIFIED_NAME);
RangerAtlasEntity entity = getHdfsPathEntity(entAttribs);
RangerServiceResource resource = resourceMapper.buildResource(entity);
assertServiceResource(resource);
}
use of org.apache.ranger.tagsync.source.atlasrest.RangerAtlasEntity in project ranger by apache.
the class TestHdfsResourceMapper method testHdfsResourceFromPathAndClusterNameAndQualifiedName.
@Test
public void testHdfsResourceFromPathAndClusterNameAndQualifiedName() throws Exception {
Map<String, Object> entAttribs = new HashMap<String, Object>();
entAttribs.put(AtlasHdfsResourceMapper.ENTITY_ATTRIBUTE_PATH, PATH);
entAttribs.put(AtlasHdfsResourceMapper.ENTITY_ATTRIBUTE_CLUSTER_NAME, CLUSTER_NAME);
entAttribs.put(AtlasHdfsResourceMapper.ENTITY_ATTRIBUTE_QUALIFIED_NAME, QUALIFIED_NAME);
RangerAtlasEntity entity = getHdfsPathEntity(entAttribs);
RangerServiceResource resource = resourceMapper.buildResource(entity);
assertServiceResource(resource);
}
use of org.apache.ranger.tagsync.source.atlasrest.RangerAtlasEntity in project ranger by apache.
the class TestHdfsResourceMapper method getHdfsPathEntity.
private RangerAtlasEntity getHdfsPathEntity(Map<String, Object> entAttribs) throws Exception {
RangerAtlasEntity entity = Mockito.mock(RangerAtlasEntity.class);
Mockito.when(entity.getTypeName()).thenReturn(AtlasHdfsResourceMapper.ENTITY_TYPE_HDFS_PATH);
Mockito.when(entity.getAttributes()).thenReturn(entAttribs);
Mockito.when(entity.getAttributes()).thenReturn(entAttribs);
Mockito.when(entity.getAttributes()).thenReturn(entAttribs);
return entity;
}
use of org.apache.ranger.tagsync.source.atlasrest.RangerAtlasEntity in project ranger by apache.
the class TestHdfsResourceMapper method testHdfsResourceFromPathAndClusterNameFromDefault.
@Test
public void testHdfsResourceFromPathAndClusterNameFromDefault() throws Exception {
Map<String, Object> entAttribs = new HashMap<String, Object>();
entAttribs.put(AtlasHdfsResourceMapper.ENTITY_ATTRIBUTE_PATH, PATH);
RangerAtlasEntity entity = getHdfsPathEntity(entAttribs);
RangerServiceResource resource = resourceMapperWithDefaultClusterName.buildResource(entity);
assertServiceResource(resource);
}
use of org.apache.ranger.tagsync.source.atlasrest.RangerAtlasEntity in project ranger by apache.
the class TestHdfsResourceMapper method testHdfsResourceFromQualifiedNameAndNameServiceIdFromProperty.
@Test
public void testHdfsResourceFromQualifiedNameAndNameServiceIdFromProperty() throws Exception {
Map<String, Object> entAttribs = new HashMap<String, Object>();
entAttribs.put(AtlasHdfsResourceMapper.ENTITY_ATTRIBUTE_QUALIFIED_NAME, QUALIFIED_NAME);
entAttribs.put(AtlasHdfsResourceMapper.ENTITY_ATTRIBUTE_NAME_SERVICE_ID, NAMESERVICE_ID);
RangerAtlasEntity entity = getHdfsPathEntity(entAttribs);
RangerServiceResource resource = resourceMapperWithFederatedService.buildResource(entity);
assertServiceResource(resource);
}
Aggregations