Search in sources :

Example 21 with RangerAtlasEntity

use of org.apache.ranger.tagsync.source.atlasrest.RangerAtlasEntity in project ranger by apache.

the class TestHbaseResourceMapper method testHbaseDottedTable.

@Test
public void testHbaseDottedTable() throws Exception {
    Map<String, Object> entAttribs = new HashMap<String, Object>();
    entAttribs.put(ENTITY_ATTRIBUTE_QUALIFIED_NAME, DOTTED_TABLE_QUALIFIED_NAME);
    RangerAtlasEntity entity = getHbaseTableEntity(entAttribs);
    RangerServiceResource resource = resourceMapper.buildResource(entity);
    assertTableResource(resource, true);
}
Also used : RangerAtlasEntity(org.apache.ranger.tagsync.source.atlasrest.RangerAtlasEntity) HashMap(java.util.HashMap) RangerServiceResource(org.apache.ranger.plugin.model.RangerServiceResource) Test(org.junit.Test)

Example 22 with RangerAtlasEntity

use of org.apache.ranger.tagsync.source.atlasrest.RangerAtlasEntity in project ranger by apache.

the class TestHbaseResourceMapper method testHbaseDottedColumnFamily.

@Test
public void testHbaseDottedColumnFamily() throws Exception {
    Map<String, Object> entAttribs = new HashMap<String, Object>();
    entAttribs.put(ENTITY_ATTRIBUTE_QUALIFIED_NAME, DOTTED_COLUMN_FAMILY_QUALIFIED_NAME);
    RangerAtlasEntity entity = getHbaseColumnFamilyEntity(entAttribs);
    RangerServiceResource resource = resourceMapper.buildResource(entity);
    assertColumnFamilyResource(resource, true);
}
Also used : RangerAtlasEntity(org.apache.ranger.tagsync.source.atlasrest.RangerAtlasEntity) HashMap(java.util.HashMap) RangerServiceResource(org.apache.ranger.plugin.model.RangerServiceResource) Test(org.junit.Test)

Example 23 with RangerAtlasEntity

use of org.apache.ranger.tagsync.source.atlasrest.RangerAtlasEntity in project ranger by apache.

the class TestHbaseResourceMapper method getHbaseNamespaceEntity.

private RangerAtlasEntity getHbaseNamespaceEntity(Map<String, Object> entAttribs) throws Exception {
    RangerAtlasEntity entity = Mockito.mock(RangerAtlasEntity.class);
    Mockito.when(entity.getTypeName()).thenReturn(AtlasHbaseResourceMapper.ENTITY_TYPE_HBASE_NAMESPACE);
    Mockito.when(entity.getAttributes()).thenReturn(entAttribs);
    return entity;
}
Also used : RangerAtlasEntity(org.apache.ranger.tagsync.source.atlasrest.RangerAtlasEntity)

Example 24 with RangerAtlasEntity

use of org.apache.ranger.tagsync.source.atlasrest.RangerAtlasEntity in project ranger by apache.

the class TestHbaseResourceMapper method testHbaseColumn.

@Test
public void testHbaseColumn() throws Exception {
    Map<String, Object> entAttribs = new HashMap<String, Object>();
    entAttribs.put(ENTITY_ATTRIBUTE_QUALIFIED_NAME, COLUMN_QUALIFIED_NAME);
    RangerAtlasEntity entity = getHbaseColumnEntity(entAttribs);
    RangerServiceResource resource = resourceMapper.buildResource(entity);
    assertColumnResource(resource, false);
}
Also used : RangerAtlasEntity(org.apache.ranger.tagsync.source.atlasrest.RangerAtlasEntity) HashMap(java.util.HashMap) RangerServiceResource(org.apache.ranger.plugin.model.RangerServiceResource) Test(org.junit.Test)

Example 25 with RangerAtlasEntity

use of org.apache.ranger.tagsync.source.atlasrest.RangerAtlasEntity in project ranger by apache.

the class TestHbaseResourceMapper method testHbaseTable.

@Test
public void testHbaseTable() throws Exception {
    Map<String, Object> entAttribs = new HashMap<String, Object>();
    entAttribs.put(ENTITY_ATTRIBUTE_QUALIFIED_NAME, TABLE_QUALIFIED_NAME);
    RangerAtlasEntity entity = getHbaseTableEntity(entAttribs);
    RangerServiceResource resource = resourceMapper.buildResource(entity);
    assertTableResource(resource, false);
}
Also used : RangerAtlasEntity(org.apache.ranger.tagsync.source.atlasrest.RangerAtlasEntity) HashMap(java.util.HashMap) RangerServiceResource(org.apache.ranger.plugin.model.RangerServiceResource) Test(org.junit.Test)

Aggregations

RangerAtlasEntity (org.apache.ranger.tagsync.source.atlasrest.RangerAtlasEntity)40 RangerServiceResource (org.apache.ranger.plugin.model.RangerServiceResource)30 HashMap (java.util.HashMap)29 Test (org.junit.Test)28 ServiceTags (org.apache.ranger.plugin.util.ServiceTags)3 RangerTagDef (org.apache.ranger.plugin.model.RangerTagDef)2 ArrayList (java.util.ArrayList)1 Map (java.util.Map)1 RangerTag (org.apache.ranger.plugin.model.RangerTag)1 RangerTagAttributeDef (org.apache.ranger.plugin.model.RangerTagDef.RangerTagAttributeDef)1 RangerAtlasEntityWithTags (org.apache.ranger.tagsync.source.atlasrest.RangerAtlasEntityWithTags)1