XAuditREST { @GET @Path("/trx_log") @Produces({ "application/xml", "application/json" }) @PreAuthorize("@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.SEARCH_X_TRX_LOG + "\")") public VXTrxLogList searchXTrxLogs(@Context HttpServletRequest request) { SearchCriteria searchCriteria = searchUtil.extractCommonCriterias( request, xTrxLogService.sortFields); return xAuditMgr.searchXTrxLogs(searchCriteria); }  @GET @Path("/trx_log/{id}") @Produces({ "application/xml", "application/json" }) @PreAuthorize("@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.GET_X_TRX_LOG + "\")") VXTrxLog getXTrxLog(
			@PathParam("id") Long id); @POST @Path("/trx_log") @Produces({ "application/xml", "application/json" }) @PreAuthorize("@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.CREATE_X_TRX_LOG + "\")") VXTrxLog createXTrxLog(VXTrxLog vXTrxLog); @PUT @Path("/trx_log") @Produces({ "application/xml", "application/json" }) @PreAuthorize("@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.UPDATE_X_TRX_LOG + "\")") VXTrxLog updateXTrxLog(VXTrxLog vXTrxLog); @DELETE @Path("/trx_log/{id}") @PreAuthorize("@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.DELETE_X_TRX_LOG + "\")") @RangerAnnotationClassName(class_name = VXTrxLog.class) void deleteXTrxLog(@PathParam("id") Long id,
			@Context HttpServletRequest request); @GET @Path("/trx_log") @Produces({ "application/xml", "application/json" }) @PreAuthorize("@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.SEARCH_X_TRX_LOG + "\")") VXTrxLogList searchXTrxLogs(@Context HttpServletRequest request); @GET @Path("/trx_log/count") @Produces({ "application/xml", "application/json" }) @PreAuthorize("@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.COUNT_X_TRX_LOGS + "\")") VXLong countXTrxLogs(@Context HttpServletRequest request); @GET @Path("/access_audit") @Produces({ "application/xml", "application/json" }) @PreAuthorize("@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.SEARCH_X_ACCESS_AUDITS + "\")") VXAccessAuditList searchXAccessAudits(@Context HttpServletRequest request); @GET @Path("/access_audit/count") @Produces({ "application/xml", "application/json" }) @PreAuthorize("@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.COUNT_X_ACCESS_AUDITS + "\")") VXLong countXAccessAudits(@Context HttpServletRequest request);  }
@SuppressWarnings("unchecked") @Test public void Test5searchXTrxLog() { VXTrxLogList vxExpList = new VXTrxLogList(); HttpServletRequest request = Mockito.mock(HttpServletRequest.class); searchCriteria.addParam("name", name); Mockito.when(searchUtil.extractCommonCriterias((HttpServletRequest) Mockito.any(), (List<SortField>) Mockito.any())).thenReturn(searchCriteria); Mockito.when(xAuditMgr.searchXTrxLogs(searchCriteria)).thenReturn(vxExpList); VXTrxLogList vxActList = auditREST.searchXTrxLogs(request); Assert.assertNotNull(vxActList); Assert.assertEquals(vxExpList, vxActList); Mockito.verify(searchUtil).extractCommonCriterias((HttpServletRequest) Mockito.any(), (List<SortField>) Mockito.any()); Mockito.verify(xAuditMgr).searchXTrxLogs(searchCriteria); }