use of org.camunda.bpm.engine.rest.dto.HistoryTimeToLiveDto in project camunda-bpm-platform by camunda.
the class DecisionDefinitionRestServiceInteractionTest method testUpdateHistoryTimeToLiveAuthorizationException.
@Test
public void testUpdateHistoryTimeToLiveAuthorizationException() {
String expectedMessage = "expectedMessage";
doThrow(new AuthorizationException(expectedMessage)).when(repositoryServiceMock).updateDecisionDefinitionHistoryTimeToLive(eq(MockProvider.EXAMPLE_DECISION_DEFINITION_ID), eq(5));
given().pathParam("id", MockProvider.EXAMPLE_DECISION_DEFINITION_ID).content(new HistoryTimeToLiveDto(5)).contentType(ContentType.JSON).then().expect().statusCode(Status.FORBIDDEN.getStatusCode()).body("type", is(AuthorizationException.class.getSimpleName())).body("message", containsString(expectedMessage)).when().put(UPDATE_HISTORY_TIME_TO_LIVE_URL);
verify(repositoryServiceMock).updateDecisionDefinitionHistoryTimeToLive(MockProvider.EXAMPLE_DECISION_DEFINITION_ID, 5);
}
use of org.camunda.bpm.engine.rest.dto.HistoryTimeToLiveDto in project camunda-bpm-platform by camunda.
the class DecisionDefinitionRestServiceInteractionTest method testUpdateHistoryTimeToLiveNullValue.
@Test
public void testUpdateHistoryTimeToLiveNullValue() {
given().pathParam("id", MockProvider.EXAMPLE_DECISION_DEFINITION_ID).content(new HistoryTimeToLiveDto()).contentType(ContentType.JSON).then().expect().statusCode(Status.NO_CONTENT.getStatusCode()).when().put(UPDATE_HISTORY_TIME_TO_LIVE_URL);
verify(repositoryServiceMock).updateDecisionDefinitionHistoryTimeToLive(MockProvider.EXAMPLE_DECISION_DEFINITION_ID, null);
}
use of org.camunda.bpm.engine.rest.dto.HistoryTimeToLiveDto in project camunda-bpm-platform by camunda.
the class CaseDefinitionRestServiceInteractionTest method testUpdateHistoryTimeToLiveAuthorizationException.
@Test
public void testUpdateHistoryTimeToLiveAuthorizationException() {
String expectedMessage = "expectedMessage";
doThrow(new AuthorizationException(expectedMessage)).when(repositoryServiceMock).updateCaseDefinitionHistoryTimeToLive(eq(MockProvider.EXAMPLE_CASE_DEFINITION_ID), eq(5));
given().pathParam("id", MockProvider.EXAMPLE_CASE_DEFINITION_ID).content(new HistoryTimeToLiveDto(5)).contentType(ContentType.JSON).then().expect().statusCode(Status.FORBIDDEN.getStatusCode()).body("type", is(AuthorizationException.class.getSimpleName())).body("message", containsString(expectedMessage)).when().put(UPDATE_HISTORY_TIME_TO_LIVE_URL);
verify(repositoryServiceMock).updateCaseDefinitionHistoryTimeToLive(MockProvider.EXAMPLE_CASE_DEFINITION_ID, 5);
}
use of org.camunda.bpm.engine.rest.dto.HistoryTimeToLiveDto in project camunda-bpm-platform by camunda.
the class CaseDefinitionRestServiceInteractionTest method testUpdateHistoryTimeToLiveNullValue.
@Test
public void testUpdateHistoryTimeToLiveNullValue() {
given().pathParam("id", MockProvider.EXAMPLE_CASE_DEFINITION_ID).content(new HistoryTimeToLiveDto()).contentType(ContentType.JSON).then().expect().statusCode(Status.NO_CONTENT.getStatusCode()).when().put(UPDATE_HISTORY_TIME_TO_LIVE_URL);
verify(repositoryServiceMock).updateCaseDefinitionHistoryTimeToLive(MockProvider.EXAMPLE_CASE_DEFINITION_ID, null);
}
use of org.camunda.bpm.engine.rest.dto.HistoryTimeToLiveDto in project camunda-bpm-platform by camunda.
the class ProcessDefinitionRestServiceInteractionTest method testUpdateHistoryTimeToLiveAuthorizationException.
@Test
public void testUpdateHistoryTimeToLiveAuthorizationException() {
String expectedMessage = "expectedMessage";
doThrow(new AuthorizationException(expectedMessage)).when(repositoryServiceMock).updateProcessDefinitionHistoryTimeToLive(eq(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID), eq(5));
given().pathParam("id", MockProvider.EXAMPLE_PROCESS_DEFINITION_ID).content(new HistoryTimeToLiveDto(5)).contentType(ContentType.JSON).then().expect().statusCode(Status.FORBIDDEN.getStatusCode()).body("type", is(AuthorizationException.class.getSimpleName())).body("message", containsString(expectedMessage)).when().put(SINGLE_PROCESS_DEFINITION_HISTORY_TIMETOLIVE_URL);
verify(repositoryServiceMock).updateProcessDefinitionHistoryTimeToLive(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID, 5);
}
Aggregations