use of org.apache.ranger.view.VXModuleDef in project ranger by apache.
the class TestXUserMgr method test31createXModuleDefPermission.
// Module permission
@Test
public void test31createXModuleDefPermission() {
VXModuleDef vXModuleDef = vXModuleDef();
Mockito.when(xModuleDefService.createResource(vXModuleDef)).thenReturn(vXModuleDef);
XXModuleDefDao obj = Mockito.mock(XXModuleDefDao.class);
Mockito.when(daoManager.getXXModuleDef()).thenReturn(obj);
VXModuleDef dbMuduleDef = xUserMgr.createXModuleDefPermission(vXModuleDef);
Assert.assertNotNull(dbMuduleDef);
Assert.assertEquals(dbMuduleDef, vXModuleDef);
Assert.assertEquals(dbMuduleDef.getId(), vXModuleDef.getId());
Assert.assertEquals(dbMuduleDef.getOwner(), vXModuleDef.getOwner());
Assert.assertEquals(dbMuduleDef.getUpdatedBy(), vXModuleDef.getUpdatedBy());
Assert.assertEquals(dbMuduleDef.getUrl(), vXModuleDef.getUrl());
Assert.assertEquals(dbMuduleDef.getAddedById(), vXModuleDef.getAddedById());
Assert.assertEquals(dbMuduleDef.getCreateDate(), vXModuleDef.getCreateDate());
Assert.assertEquals(dbMuduleDef.getCreateTime(), vXModuleDef.getCreateTime());
Assert.assertEquals(dbMuduleDef.getUserPermList(), vXModuleDef.getUserPermList());
Assert.assertEquals(dbMuduleDef.getGroupPermList(), vXModuleDef.getGroupPermList());
Mockito.verify(xModuleDefService).createResource(vXModuleDef);
}
Aggregations