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

            HistoricExternalTaskLogQuery invalidQueryNonExistingHistoricExternalTaskLog = mock(typeof(HistoricExternalTaskLogQuery));

            when(mockHistoryService.createHistoricExternalTaskLogQuery().logId(id)).thenReturn(invalidQueryNonExistingHistoricExternalTaskLog);
            when(invalidQueryNonExistingHistoricExternalTaskLog.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 external task log with id " + id + " does not exist")).when().get(SINGLE_HISTORIC_EXTERNAL_TASK_LOG_RESOURCE_URL);
        }
Exemplo 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(HistoricExternalTaskLogQuery));

            HistoricExternalTaskLog mockedHistoricExternalTaskLog = MockProvider.createMockHistoricExternalTaskLog();

            when(mockQuery.singleResult()).thenReturn(mockedHistoricExternalTaskLog);
            when(mockQuery.logId(MockProvider.EXAMPLE_HISTORIC_EXTERNAL_TASK_LOG_ID)).thenReturn(mockQuery);

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

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