//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldSetRemovalTime_Response() public virtual void shouldSetRemovalTime_Response() { SetRemovalTimeSelectModeForHistoricBatchesBuilder builderMock = mock(typeof(SetRemovalTimeSelectModeForHistoricBatchesBuilder), RETURNS_DEEP_STUBS); when(historyServiceMock.setRemovalTimeToHistoricBatches()).thenReturn(builderMock); Batch batchEntity = MockProvider.createMockBatch(); when(builderMock.executeAsync()).thenReturn(batchEntity); Response response = given().contentType(ContentType.JSON).body(Collections.emptyMap()).then().expect().statusCode(Status.OK.StatusCode).when().post(SET_REMOVAL_TIME_HISTORIC_BATCHES_ASYNC_URL); verifyBatchJson(response.asString()); }
public virtual BatchDto setRemovalTimeAsync(SetRemovalTimeToHistoricBatchesDto dto) { HistoryService historyService = processEngine.HistoryService; HistoricBatchQuery historicBatchQuery = null; if (dto.HistoricBatchQuery != null) { historicBatchQuery = dto.HistoricBatchQuery.toQuery(processEngine); } SetRemovalTimeSelectModeForHistoricBatchesBuilder builder = historyService.setRemovalTimeToHistoricBatches(); if (dto.CalculatedRemovalTime) { builder.calculatedRemovalTime(); } DateTime removalTime = dto.AbsoluteRemovalTime; if (dto.AbsoluteRemovalTime != null) { builder.absoluteRemovalTime(removalTime); } if (dto.ClearedRemovalTime) { builder.clearedRemovalTime(); } builder.byIds(dto.HistoricBatchIds); builder.byQuery(historicBatchQuery); Batch batch = builder.executeAsync(); return(BatchDto.fromBatch(batch)); }