use of org.apache.ranger.view.VXPolicyExportAudit in project ranger by apache.
the class XPolicyExportAuditServiceBase method searchXPolicyExportAudits.
/**
* @param searchCriteria
* @return
*/
public VXPolicyExportAuditList searchXPolicyExportAudits(SearchCriteria searchCriteria) {
VXPolicyExportAuditList returnList = new VXPolicyExportAuditList();
List<VXPolicyExportAudit> xPolicyExportAuditList = new ArrayList<VXPolicyExportAudit>();
List<T> resultList = searchResources(searchCriteria, searchFields, sortFields, returnList);
// Iterate over the result list and create the return list
for (T gjXPolicyExportAudit : resultList) {
VXPolicyExportAudit vXPolicyExportAudit = populateViewBean(gjXPolicyExportAudit);
xPolicyExportAuditList.add(vXPolicyExportAudit);
}
returnList.setVXPolicyExportAudits(xPolicyExportAuditList);
return returnList;
}
use of org.apache.ranger.view.VXPolicyExportAudit in project ranger by apache.
the class TestAssetREST method testSearchXPolicyExportAudits.
@Test
public void testSearchXPolicyExportAudits() {
SearchCriteria searchCriteria = new SearchCriteria();
List<SortField> sortFields = null;
List<VXPolicyExportAudit> vXPolicyExportAudits = new ArrayList<VXPolicyExportAudit>();
VXPolicyExportAuditList vXPolicyExportAuditList = new VXPolicyExportAuditList();
vXPolicyExportAuditList.setVXPolicyExportAudits(vXPolicyExportAudits);
Mockito.when(searchUtil.extractCommonCriterias(request, sortFields)).thenReturn(searchCriteria);
Mockito.when(searchUtil.extractString((HttpServletRequest) Mockito.any(), (SearchCriteria) Mockito.any(), Mockito.anyString(), Mockito.anyString(), Mockito.anyString())).thenReturn("test");
Mockito.when(searchUtil.extractInt((HttpServletRequest) Mockito.any(), (SearchCriteria) Mockito.any(), Mockito.anyString(), Mockito.anyString())).thenReturn((Integer) 8);
Mockito.when(assetMgr.searchXPolicyExportAudits(searchCriteria)).thenReturn(vXPolicyExportAuditList);
VXPolicyExportAuditList expectedVXPolicyExportAuditList = assetREST.searchXPolicyExportAudits(request);
Assert.assertEquals(vXPolicyExportAuditList, expectedVXPolicyExportAuditList);
Mockito.verify(searchUtil).extractCommonCriterias(request, sortFields);
Mockito.verify(searchUtil, Mockito.times(4)).extractString((HttpServletRequest) Mockito.any(), (SearchCriteria) Mockito.any(), Mockito.anyString(), Mockito.anyString(), Mockito.anyString());
Mockito.verify(searchUtil).extractInt((HttpServletRequest) Mockito.any(), (SearchCriteria) Mockito.any(), Mockito.anyString(), Mockito.anyString());
Mockito.verify(searchUtil, Mockito.times(2)).extractDate((HttpServletRequest) Mockito.any(), (SearchCriteria) Mockito.any(), Mockito.anyString(), Mockito.anyString(), (String) Mockito.isNull());
Mockito.verify(searchUtil).extractCommonCriterias(request, sortFields);
Mockito.verify(assetMgr).searchXPolicyExportAudits(searchCriteria);
}
Aggregations