Search in sources :

Example 6 with XXTagDefDao

use of org.apache.ranger.db.XXTagDefDao in project ranger by apache.

the class TestRangerTagDefService method test7getTagDefByName.

@Test
public void test7getTagDefByName() {
    XXTagDef xxTagDef = null;
    XXTagDefDao xXTagDefDao = Mockito.mock(XXTagDefDao.class);
    Mockito.when(daoMgr.getXXTagDef()).thenReturn(xXTagDefDao);
    Mockito.when(xXTagDefDao.findByName(name)).thenReturn(xxTagDef);
    RangerTagDef result = rangerTagDefService.getTagDefByName(name);
    Assert.assertNull(result);
    Mockito.verify(daoMgr).getXXTagDef();
    Mockito.verify(xXTagDefDao).findByName(name);
}
Also used : RangerTagDef(org.apache.ranger.plugin.model.RangerTagDef) XXTagDef(org.apache.ranger.entity.XXTagDef) XXTagDefDao(org.apache.ranger.db.XXTagDefDao) Test(org.junit.Test)

Aggregations

XXTagDefDao (org.apache.ranger.db.XXTagDefDao)6 XXTagDef (org.apache.ranger.entity.XXTagDef)6 RangerTagDef (org.apache.ranger.plugin.model.RangerTagDef)6 Test (org.junit.Test)6 ArrayList (java.util.ArrayList)4 XXTagAttributeDefDao (org.apache.ranger.db.XXTagAttributeDefDao)3 XXTagAttributeDef (org.apache.ranger.entity.XXTagAttributeDef)3 Date (java.util.Date)2