Search in sources :

Example 16 with VXAuditMap

use of org.apache.ranger.view.VXAuditMap in project ranger by apache.

the class TestXUserREST method test57updateXAuditMapNull.

@Test
public void test57updateXAuditMapNull() {
    VXAuditMap testvXAuditMap = createVXAuditMapObj();
    Mockito.when(restErrorUtil.createRESTException(Mockito.anyString(), (MessageEnums) Mockito.any())).thenThrow(new WebApplicationException());
    thrown.expect(WebApplicationException.class);
    VXAuditMap retvXAuditMap = xUserRest.updateXAuditMap(testvXAuditMap);
    assertNull(retvXAuditMap);
    Mockito.verify(xUserMgr).updateXAuditMap(testvXAuditMap);
    Mockito.verify(xResourceService).readResource(null);
    Mockito.verify(restErrorUtil.createRESTException(Mockito.anyString(), (MessageEnums) Mockito.any()));
}
Also used : WebApplicationException(javax.ws.rs.WebApplicationException) MessageEnums(org.apache.ranger.common.MessageEnums) VXAuditMap(org.apache.ranger.view.VXAuditMap) Test(org.junit.Test)

Aggregations

VXAuditMap (org.apache.ranger.view.VXAuditMap)16 Test (org.junit.Test)10 VXResource (org.apache.ranger.view.VXResource)6 ArrayList (java.util.ArrayList)5 WebApplicationException (javax.ws.rs.WebApplicationException)3 MessageEnums (org.apache.ranger.common.MessageEnums)3 VXAuditMapList (org.apache.ranger.view.VXAuditMapList)3 VXPermMap (org.apache.ranger.view.VXPermMap)3 SearchCriteria (org.apache.ranger.common.SearchCriteria)2 Date (java.util.Date)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1 SortField (org.apache.ranger.common.SortField)1 XXAsset (org.apache.ranger.entity.XXAsset)1 XXAuditMap (org.apache.ranger.entity.XXAuditMap)1 XXResource (org.apache.ranger.entity.XXResource)1 RangerPolicy (org.apache.ranger.plugin.model.RangerPolicy)1 VXPermMapList (org.apache.ranger.view.VXPermMapList)1