### Question:
AuditBean { @POST @Path("/audit") @Consumes("*/*") @Produces({"application/xml", "text/xml", "application/json", "text/yaml", "text/x-yaml", "application/x-yaml", "application/x-protobuf", "application/x-protostuff"}) @GZIP public VoidResponse auditRest(MultivaluedMap<String,String> parameters) { VoidResponse response = new VoidResponse(); try { auditService.audit(auditParameterBuilder.validate(parameters)); return response; } catch (Exception e) { QueryException qe = new QueryException(DatawaveErrorCode.AUDITING_ERROR, e); log.error(qe); response.addException(qe.getBottomQueryException()); int statusCode = qe.getBottomQueryException().getStatusCode(); throw new DatawaveWebApplicationException(qe, response, statusCode); } }  @POST @Path("/audit") @Consumes("*/*") @Produces({"application/xml", "text/xml", "application/json", "text/yaml", "text/x-yaml", "application/x-yaml", "application/x-protobuf", "application/x-protostuff"}) @GZIP VoidResponse auditRest(MultivaluedMap<String,String> parameters); String audit(MultivaluedMap<String,String> parameters);  }### Answer:
@Test public void restCallTest() { MultivaluedMap<String,String> mvMapParams = new MultivaluedMapImpl<>(); mvMapParams.putAll(params); auditBean.auditRest(mvMapParams); AuditParameters expected = new AuditParameters(); expected.validate(mvMapParams); AuditParameters actual = new AuditParameters(); actual.validate(AuditParameters.parseMessage(auditor.params)); assertEquals(expected.getUserDn(), actual.getUserDn()); assertEquals(expected.getQuery(), actual.getQuery()); assertEquals(expected.getSelectors(), actual.getSelectors()); assertEquals(expected.getAuths(), actual.getAuths()); assertEquals(expected.getAuditType(), actual.getAuditType()); assertEquals(expected.getColviz(), actual.getColviz()); }
@Test public void internalCallTest() { MultivaluedMap<String,String> paramsMap = new MultivaluedMapImpl<>(); paramsMap.putAll(params); AuditParameters auditParams = new AuditParameters(); auditParams.validate(params); auditBean.auditRest(paramsMap); AuditParameters actual = new AuditParameters(); actual.validate(AuditParameters.parseMessage(auditor.params)); assertEquals(auditParams.getUserDn(), actual.getUserDn()); assertEquals(auditParams.getQuery(), actual.getQuery()); assertEquals(auditParams.getSelectors(), actual.getSelectors()); assertEquals(auditParams.getAuths(), actual.getAuths()); assertEquals(auditParams.getAuditType(), actual.getAuditType()); assertEquals(auditParams.getColviz(), actual.getColviz()); }