### Question:
ApiManagerAuditProcessor { public OperationType getAuditOperationFromMethod(String method) { OperationType operationType = null; if (method != null) { if (method.equalsIgnoreCase(ApiOperation.Type.GET.name())) { operationType = OperationType.QUERY; } else if (method.equalsIgnoreCase(ApiOperation.Type.POST.name())) { operationType = OperationType.INSERT; } else if (method.equalsIgnoreCase(ApiOperation.Type.PUT.name())) { operationType = OperationType.UPDATE; } else if (method.equalsIgnoreCase(ApiOperation.Type.DELETE.name())) { operationType = OperationType.DELETE; } } log.debug("The audit operation from method {} is {} ", method, operationType); return operationType; }  ApiManagerAuditEvent getStoppedEvent(Map<String, Object> data); ApiManagerAuditEvent getEvent(Map<String, Object> data); OPAuditError getErrorEvent(Map<String, Object> data, Exception ex); ApiManagerAuditEvent completeEvent(ApiManagerAuditEvent event); OperationType getAuditOperationFromMethod(String method); String getUserId(User user); String getOntologyId(Ontology ontology); String getOperation(OperationType operationType);  }### Answer:
@Test public void given_getAuditOperationFromMethod_with_get_method() { final OperationType operationType = apiManagerAuditProcessor .getAuditOperationFromMethod(ApiOperation.Type.GET.name()); assertEquals(OperationType.QUERY, operationType); }
@Test public void given_getAuditOperationFromMethod_with_post_method() { final OperationType operationType = apiManagerAuditProcessor .getAuditOperationFromMethod(ApiOperation.Type.POST.name()); assertEquals(OperationType.INSERT, operationType); }
@Test public void given_getAuditOperationFromMethod_with_put_method() { final OperationType operationType = apiManagerAuditProcessor .getAuditOperationFromMethod(ApiOperation.Type.PUT.name()); assertEquals(OperationType.UPDATE, operationType); }
@Test public void given_getAuditOperationFromMethod_with_delete_method() { final OperationType operationType = apiManagerAuditProcessor .getAuditOperationFromMethod(ApiOperation.Type.DELETE.name()); assertEquals(OperationType.DELETE, operationType); }
@Test public void given_getAuditOperationFromMethod_with_an_unexisting_method() { final OperationType operationType = apiManagerAuditProcessor.getAuditOperationFromMethod(""); Assert.assertNull(operationType); }
@Test public void given_getAuditOperationFromMethod_with_null_method() { final OperationType operationType = apiManagerAuditProcessor.getAuditOperationFromMethod(null); Assert.assertNull(operationType); }