public Incident createIncident(String incidentType, String executionId, String configuration) { return createIncident(incidentType, executionId, configuration, null); }
public Incident createIncident(String incidentType, String executionId, String configuration) { return createIncident(incidentType, executionId, configuration, null); }
@Test public void testCreateIncident() { when(runtimeServiceMock.createIncident(anyString(), anyString(), anyString(), anyString())).thenReturn(mock(Incident.class)); Map<String, Object> json = new HashMap<String, Object>(); json.put("incidentType", "incidentType"); json.put("configuration", "configuration"); json.put("message", "message"); given().pathParam("id", MockProvider.EXAMPLE_EXECUTION_ID).contentType(ContentType.JSON).body(json).then().expect().statusCode(Status.OK.getStatusCode()) .when().post(CREATE_INCIDENT_URL); verify(runtimeServiceMock).createIncident("incidentType", MockProvider.EXAMPLE_EXECUTION_ID, "configuration", "message"); }
@Test public void testCreateIncidentWithNullIncidentType() { doThrow(new BadUserRequestException()).when(runtimeServiceMock).createIncident(anyString(), anyString(), anyString(), anyString()); Map<String, Object> json = new HashMap<String, Object>(); json.put("configuration", "configuration"); json.put("message", "message"); given().pathParam("id", MockProvider.EXAMPLE_EXECUTION_ID).contentType(ContentType.JSON).body(json).then().expect() .statusCode(Status.BAD_REQUEST.getStatusCode()).when().post(CREATE_INCIDENT_URL); } }
public Incident createIncident(String incidentType, String executionId, String configuration) { return createIncident(incidentType, executionId, configuration, null); }