use of org.camunda.bpm.engine.rest.dto.HistoryTimeToLiveDto in project camunda-bpm-platform by camunda.
the class ProcessDefinitionRestServiceInteractionTest method testUpdateHistoryTimeToLiveNegativeValue.
@Test
public void testUpdateHistoryTimeToLiveNegativeValue() {
String expectedMessage = "expectedMessage";
doThrow(new BadUserRequestException(expectedMessage)).when(repositoryServiceMock).updateProcessDefinitionHistoryTimeToLive(eq(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID), eq(-1));
given().pathParam("id", MockProvider.EXAMPLE_PROCESS_DEFINITION_ID).content(new HistoryTimeToLiveDto(-1)).contentType(ContentType.JSON).then().expect().statusCode(Status.BAD_REQUEST.getStatusCode()).body("type", is(BadUserRequestException.class.getSimpleName())).body("message", containsString(expectedMessage)).when().put(SINGLE_PROCESS_DEFINITION_HISTORY_TIMETOLIVE_URL);
verify(repositoryServiceMock).updateProcessDefinitionHistoryTimeToLive(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID, -1);
}
use of org.camunda.bpm.engine.rest.dto.HistoryTimeToLiveDto in project camunda-bpm-platform by camunda.
the class ProcessDefinitionRestServiceInteractionTest method testUpdateHistoryTimeToLive.
@Test
public void testUpdateHistoryTimeToLive() {
given().pathParam("id", MockProvider.EXAMPLE_PROCESS_DEFINITION_ID).content(new HistoryTimeToLiveDto(5)).contentType(ContentType.JSON).then().expect().statusCode(Status.NO_CONTENT.getStatusCode()).when().put(SINGLE_PROCESS_DEFINITION_HISTORY_TIMETOLIVE_URL);
verify(repositoryServiceMock).updateProcessDefinitionHistoryTimeToLive(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID, 5);
}
use of org.camunda.bpm.engine.rest.dto.HistoryTimeToLiveDto in project camunda-bpm-platform by camunda.
the class ProcessDefinitionRestServiceInteractionTest method testUpdateHistoryTimeToLiveNullValue.
@Test
public void testUpdateHistoryTimeToLiveNullValue() {
given().pathParam("id", MockProvider.EXAMPLE_PROCESS_DEFINITION_ID).content(new HistoryTimeToLiveDto()).contentType(ContentType.JSON).then().expect().statusCode(Status.NO_CONTENT.getStatusCode()).when().put(SINGLE_PROCESS_DEFINITION_HISTORY_TIMETOLIVE_URL);
verify(repositoryServiceMock).updateProcessDefinitionHistoryTimeToLive(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID, null);
}
use of org.camunda.bpm.engine.rest.dto.HistoryTimeToLiveDto in project camunda-bpm-platform by camunda.
the class DecisionDefinitionRestServiceInteractionTest method testUpdateHistoryTimeToLive.
@Test
public void testUpdateHistoryTimeToLive() {
given().pathParam("id", MockProvider.EXAMPLE_DECISION_DEFINITION_ID).content(new HistoryTimeToLiveDto(5)).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, 5);
}
use of org.camunda.bpm.engine.rest.dto.HistoryTimeToLiveDto in project camunda-bpm-platform by camunda.
the class DecisionDefinitionRestServiceInteractionTest method testUpdateHistoryTimeToLiveNegativeValue.
@Test
public void testUpdateHistoryTimeToLiveNegativeValue() {
String expectedMessage = "expectedMessage";
doThrow(new BadUserRequestException(expectedMessage)).when(repositoryServiceMock).updateDecisionDefinitionHistoryTimeToLive(eq(MockProvider.EXAMPLE_DECISION_DEFINITION_ID), eq(-1));
given().pathParam("id", MockProvider.EXAMPLE_DECISION_DEFINITION_ID).content(new HistoryTimeToLiveDto(-1)).contentType(ContentType.JSON).then().expect().statusCode(Status.BAD_REQUEST.getStatusCode()).body("type", is(BadUserRequestException.class.getSimpleName())).body("message", containsString(expectedMessage)).when().put(UPDATE_HISTORY_TIME_TO_LIVE_URL);
verify(repositoryServiceMock).updateDecisionDefinitionHistoryTimeToLive(MockProvider.EXAMPLE_DECISION_DEFINITION_ID, -1);
}
Aggregations