예제 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testGetNonExistingHistoricBatch()
        public virtual void testGetNonExistingHistoricBatch()
        {
            string             nonExistingId      = MockProvider.NON_EXISTING_ID;
            HistoricBatchQuery historicBatchQuery = mock(typeof(HistoricBatchQuery));

            when(historicBatchQuery.batchId(nonExistingId)).thenReturn(historicBatchQuery);
            when(historicBatchQuery.singleResult()).thenReturn(null);
            when(historyServiceMock.createHistoricBatchQuery()).thenReturn(historicBatchQuery);

            given().pathParam("id", nonExistingId).then().expect().statusCode(Status.NOT_FOUND.StatusCode).body("type", equalTo(typeof(InvalidRequestException).Name)).body("message", equalTo("Historic batch with id '" + nonExistingId + "' does not exist")).when().get(HISTORIC_SINGLE_BATCH_RESOURCE_URL);
        }
예제 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setUpHistoricBatchQueryMock()
        public virtual void setUpHistoricBatchQueryMock()
        {
            HistoricBatch historicBatchMock = MockProvider.createMockHistoricBatch();

            queryMock = mock(typeof(HistoricBatchQuery));
            when(queryMock.batchId(eq(MockProvider.EXAMPLE_BATCH_ID))).thenReturn(queryMock);
            when(queryMock.singleResult()).thenReturn(historicBatchMock);

            historyServiceMock = mock(typeof(HistoryService));
            when(historyServiceMock.createHistoricBatchQuery()).thenReturn(queryMock);

            when(processEngine.HistoryService).thenReturn(historyServiceMock);
        }