Ejemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testHistoricJobLogGetIdDoesntExist()
        public virtual void testHistoricJobLogGetIdDoesntExist()
        {
            string id = "nonExistingId";

            HistoricJobLogQuery invalidQueryNonExistingHistoricJobLog = mock(typeof(HistoricJobLogQuery));

            when(mockHistoryService.createHistoricJobLogQuery().logId(id)).thenReturn(invalidQueryNonExistingHistoricJobLog);
            when(invalidQueryNonExistingHistoricJobLog.singleResult()).thenReturn(null);

            given().pathParam("id", id).then().expect().statusCode(Status.NOT_FOUND.StatusCode).contentType(ContentType.JSON).body("type", equalTo(typeof(InvalidRequestException).Name)).body("message", equalTo("Historic job log with id " + id + " does not exist")).when().get(SINGLE_HISTORIC_JOB_LOG_RESOURCE_URL);
        }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setUpRuntimeData()
        public virtual void setUpRuntimeData()
        {
            mockQuery = mock(typeof(HistoricJobLogQuery));

            HistoricJobLog mockedHistoricJobLog = MockProvider.createMockHistoricJobLog();

            when(mockQuery.singleResult()).thenReturn(mockedHistoricJobLog);
            when(mockQuery.logId(MockProvider.EXAMPLE_HISTORIC_JOB_LOG_ID)).thenReturn(mockQuery);

            mockHistoryService = mock(typeof(HistoryService));
            when(mockHistoryService.createHistoricJobLogQuery()).thenReturn(mockQuery);

            namedProcessEngine = getProcessEngine(MockProvider.EXAMPLE_PROCESS_ENGINE_NAME);
            when(namedProcessEngine.HistoryService).thenReturn(mockHistoryService);
        }