//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testJobDefinitionRetrieval() public virtual void testJobDefinitionRetrieval() { string queryJobDefinitionId = "aJobDefId"; Response response = given().queryParam("jobDefinitionId", queryJobDefinitionId).then().expect().statusCode(Status.OK.StatusCode).when().get(JOB_DEFINITION_QUERY_URL); // assert query invocation InOrder inOrder = Mockito.inOrder(mockedQuery); inOrder.verify(mockedQuery).jobDefinitionId(queryJobDefinitionId); inOrder.verify(mockedQuery).list(); string content = response.asString(); IList <IDictionary <string, string> > jobDefinitions = from(content).getList(""); assertThat(jobDefinitions).hasSize(1); assertThat(jobDefinitions[0]).NotNull; string returnedId = from(content).getString("[0].id"); string returnedProcessDefinitionId = from(content).getString("[0].processDefinitionId"); string returnedProcessDefinitionKey = from(content).getString("[0].processDefinitionKey"); string returnedActivityId = from(content).getString("[0].activityId"); string returnedJobType = from(content).getString("[0].jobType"); string returnedJobConfiguration = from(content).getString("[0].jobConfiguration"); bool returnedSuspensionState = from(content).getBoolean("[0].suspended"); long? returnedJobPriority = from(content).getObject("[0].overridingJobPriority", typeof(Long)); assertThat(returnedId).isEqualTo(MockProvider.EXAMPLE_JOB_DEFINITION_ID); assertThat(returnedProcessDefinitionId).isEqualTo(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID); assertThat(returnedProcessDefinitionKey).isEqualTo(MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY); assertThat(returnedActivityId).isEqualTo(MockProvider.EXAMPLE_ACTIVITY_ID); assertThat(returnedJobType).isEqualTo(MockProvider.EXAMPLE_JOB_TYPE); assertThat(returnedJobConfiguration).isEqualTo(MockProvider.EXAMPLE_JOB_CONFIG); assertThat(returnedSuspensionState).isEqualTo(MockProvider.EXAMPLE_JOB_DEFINITION_IS_SUSPENDED); assertThat(returnedJobPriority).isEqualTo(MockProvider.EXAMPLE_JOB_DEFINITION_PRIORITY); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testCaseInstanceRetrieval() public virtual void testCaseInstanceRetrieval() { string queryCaseInstanceId = "aCaseInstanceId"; Response response = given().queryParam("caseInstanceId", queryCaseInstanceId).then().expect().statusCode(Status.OK.StatusCode).when().get(CASE_INSTANCE_QUERY_URL); // assert query invocation InOrder inOrder = Mockito.inOrder(mockedQuery); inOrder.verify(mockedQuery).caseInstanceId(queryCaseInstanceId); inOrder.verify(mockedQuery).list(); string content = response.asString(); IList <IDictionary <string, string> > caseInstances = from(content).getList(""); assertThat(caseInstances).hasSize(1); assertThat(caseInstances[0]).NotNull; string returnedId = from(content).getString("[0].id"); string returnedCaseDefinitionId = from(content).getString("[0].caseDefinitionId"); string returnedBusinessKeyKey = from(content).getString("[0].businessKey"); string returnedTenantId = from(content).getString("[0].tenantId"); bool returnedActiveState = from(content).getBoolean("[0].active"); bool returnedCompletedState = from(content).getBoolean("[0].completed"); bool returnedTerminatedState = from(content).getBoolean("[0].terminated"); assertThat(returnedId).isEqualTo(MockProvider.EXAMPLE_CASE_INSTANCE_ID); assertThat(returnedCaseDefinitionId).isEqualTo(MockProvider.EXAMPLE_CASE_INSTANCE_CASE_DEFINITION_ID); assertThat(returnedBusinessKeyKey).isEqualTo(MockProvider.EXAMPLE_CASE_INSTANCE_BUSINESS_KEY); assertThat(returnedTenantId).isEqualTo(MockProvider.EXAMPLE_TENANT_ID); assertThat(returnedActiveState).isEqualTo(MockProvider.EXAMPLE_CASE_INSTANCE_IS_ACTIVE); assertThat(returnedCompletedState).isEqualTo(MockProvider.EXAMPLE_CASE_INSTANCE_IS_COMPLETED); assertThat(returnedTerminatedState).isEqualTo(MockProvider.EXAMPLE_CASE_INSTANCE_IS_TERMINATED); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testDeploymentRetrieval() public virtual void testDeploymentRetrieval() { InOrder inOrder = Mockito.inOrder(mockedQuery); string queryKey = "Name"; Response response = given().queryParam("nameLike", queryKey).then().expect().statusCode(Status.OK.StatusCode).when().get(DEPLOYMENT_QUERY_URL); // assert query invocation inOrder.verify(mockedQuery).deploymentNameLike(queryKey); inOrder.verify(mockedQuery).list(); string content = response.asString(); IList <string> deployments = from(content).getList(""); Assert.assertEquals("There should be one deployment returned.", 1, deployments.Count); Assert.assertNotNull("There should be one deployment returned", deployments[0]); string returnedId = from(content).getString("[0].id"); string returnedName = from(content).getString("[0].name"); string returnedSource = from(content).getString("[0].source"); string returnedDeploymentTime = from(content).getString("[0].deploymentTime"); Assert.assertEquals(MockProvider.EXAMPLE_DEPLOYMENT_ID, returnedId); Assert.assertEquals(MockProvider.EXAMPLE_DEPLOYMENT_NAME, returnedName); Assert.assertEquals(MockProvider.EXAMPLE_DEPLOYMENT_SOURCE, returnedSource); Assert.assertEquals(MockProvider.EXAMPLE_DEPLOYMENT_TIME, returnedDeploymentTime); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldPrioritiseCorrectly() public virtual void ShouldPrioritiseCorrectly() { BatchingMessageHandler batchHandler = new BatchingMessageHandler(_downstreamHandler, _inQueueConfig, _batchConfig, _jobSchedulerFactory, NullLogProvider.Instance); NewEntry.Request newEntry = new NewEntry.Request(null, Content("")); AppendEntries.Request append = new AppendEntries.Request(_leader, 1, -1, -1, Entries(0, 0, 0), 0); AppendEntries.Request emptyAppend = new AppendEntries.Request(_leader, 1, -1, -1, RaftLogEntry.empty, 0); Heartbeat heartbeat = new Heartbeat(null, 0, 0, 0); batchHandler.Handle(Wrap(newEntry)); batchHandler.Handle(Wrap(append)); batchHandler.Handle(Wrap(heartbeat)); batchHandler.Handle(Wrap(emptyAppend)); verifyZeroInteractions(_downstreamHandler); // when batchHandler.Run(); batchHandler.Run(); batchHandler.Run(); batchHandler.Run(); // then InOrder inOrder = Mockito.inOrder(_downstreamHandler); inOrder.verify(_downstreamHandler).handle(Wrap(heartbeat)); inOrder.verify(_downstreamHandler).handle(Wrap(emptyAppend)); inOrder.verify(_downstreamHandler).handle(Wrap(append)); inOrder.verify(_downstreamHandler).handle(Wrap(new NewEntry.BatchRequest(singletonList(Content(""))))); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testDecisionRequirementsDefinitionRetrieval() public virtual void testDecisionRequirementsDefinitionRetrieval() { Response response = given().then().expect().statusCode(Status.OK.StatusCode).when().get(DECISION_REQUIREMENTS_DEFINITION_QUERY_URL); // assert query invocation InOrder inOrder = Mockito.inOrder(mockedQuery); inOrder.verify(mockedQuery).list(); string content = response.asString(); IList <IDictionary <string, string> > decisionRequirementsDefinitions = from(content).getList(""); assertThat(decisionRequirementsDefinitions).hasSize(1); assertThat(decisionRequirementsDefinitions[0]).NotNull; string returnedId = from(content).getString("[0].id"); string returnedKey = from(content).getString("[0].key"); string returnedCategory = from(content).getString("[0].category"); string returnedName = from(content).getString("[0].name"); int returnedVersion = from(content).getInt("[0].version"); string returnedResource = from(content).getString("[0].resource"); string returnedDeploymentId = from(content).getString("[0].deploymentId"); string returnedTenantId = from(content).getString("[0].tenantId"); assertThat(returnedId).isEqualTo(MockProvider.EXAMPLE_DECISION_REQUIREMENTS_DEFINITION_ID); assertThat(returnedKey).isEqualTo(MockProvider.EXAMPLE_DECISION_REQUIREMENTS_DEFINITION_KEY); assertThat(returnedCategory).isEqualTo(MockProvider.EXAMPLE_DECISION_REQUIREMENTS_DEFINITION_CATEGORY); assertThat(returnedName).isEqualTo(MockProvider.EXAMPLE_DECISION_REQUIREMENTS_DEFINITION_NAME); assertThat(returnedVersion).isEqualTo(MockProvider.EXAMPLE_DECISION_REQUIREMENTS_DEFINITION_VERSION); assertThat(returnedResource).isEqualTo(MockProvider.EXAMPLE_DECISION_REQUIREMENTS_DEFINITION_RESOURCE_NAME); assertThat(returnedDeploymentId).isEqualTo(MockProvider.EXAMPLE_DEPLOYMENT_ID); assertThat(returnedTenantId).isEqualTo(null); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testReportRetrieval() public virtual void testReportRetrieval() { Response response = given().then().expect().statusCode(Status.OK.StatusCode).contentType(ContentType.JSON).when().get(HISTORIC_REPORT_URL); // assert query invocation InOrder inOrder = Mockito.inOrder(historicBatchReport); inOrder.verify(historicBatchReport).list(); string content = response.asString(); IList <string> reportResults = from(content).getList(""); Assert.assertEquals("There should be two report results returned.", 2, reportResults.Count); Assert.assertNotNull(reportResults[0]); string returnedBatchType = from(content).getString("[0].batchType"); int returnedTTL = from(content).getInt("[0].historyTimeToLive"); long returnedFinishedCount = from(content).getLong("[0].finishedBatchesCount"); long returnedCleanableCount = from(content).getLong("[0].cleanableBatchesCount"); Assert.assertEquals(EXAMPLE_TYPE, returnedBatchType); Assert.assertEquals(EXAMPLE_TTL, returnedTTL); Assert.assertEquals(EXAMPLE_FINISHED_COUNT, returnedFinishedCount); Assert.assertEquals(EXAMPLE_CLEANABLE_COUNT, returnedCleanableCount); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testVariableInstanceRetrievalAsPost() public virtual void testVariableInstanceRetrievalAsPost() { string queryVariableName = "aVariableInstanceName"; IDictionary <string, string> queryParameter = new Dictionary <string, string>(); queryParameter["variableName"] = queryVariableName; Response response = given().contentType(POST_JSON_CONTENT_TYPE).body(queryParameter).then().expect().statusCode(Status.OK.StatusCode).and().body("size()", @is(1)).body("[0].id", equalTo(mockInstanceBuilder.Id)).body("[0].name", equalTo(mockInstanceBuilder.Name)).body("[0].type", equalTo(VariableTypeHelper.toExpectedValueTypeName(mockInstanceBuilder.TypedValue.Type))).body("[0].value", equalTo(mockInstanceBuilder.TypedValue.Value)).body("[0].processInstanceId", equalTo(mockInstanceBuilder.ProcessInstanceId)).body("[0].executionId", equalTo(mockInstanceBuilder.ExecutionId)).body("[0].caseInstanceId", equalTo(mockInstanceBuilder.CaseInstanceId)).body("[0].caseExecutionId", equalTo(mockInstanceBuilder.CaseExecutionId)).body("[0].taskId", equalTo(mockInstanceBuilder.TaskId)).body("[0].activityInstanceId", equalTo(mockInstanceBuilder.ActivityInstanceId)).body("[0].tenantId", equalTo(mockInstanceBuilder.TenantId)).body("[0].errorMessage", equalTo(mockInstanceBuilder.ErrorMessage)).body("[0].serializedValue", nullValue()).when().post(VARIABLE_INSTANCE_QUERY_URL); // assert query invocation InOrder inOrder = Mockito.inOrder(mockedQuery); inOrder.verify(mockedQuery).variableName(queryVariableName); inOrder.verify(mockedQuery).list(); string content = response.asString(); IList <string> variables = from(content).getList(""); Assert.assertEquals("There should be one process definition returned.", 1, variables.Count); Assert.assertNotNull("There should be one process definition returned", variables[0]); verify(mockedQuery).disableBinaryFetching(); // requirement to not break existing API; should be: // verify(mockedQuery).disableCustomObjectDeserialization(); verify(mockedQuery, never()).disableCustomObjectDeserialization(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testReportRetrieval() public virtual void testReportRetrieval() { Response response = given().then().expect().statusCode(Status.OK.StatusCode).contentType(ContentType.JSON).when().get(HISTORIC_REPORT_URL); // assert query invocation InOrder inOrder = Mockito.inOrder(historicProcessInstanceReport); inOrder.verify(historicProcessInstanceReport).list(); string content = response.asString(); IList <string> reportResults = from(content).getList(""); Assert.assertEquals("There should be two report results returned.", 2, reportResults.Count); Assert.assertNotNull(reportResults[0]); string returnedDefinitionId = from(content).getString("[0].processDefinitionId"); string returnedDefinitionKey = from(content).getString("[0].processDefinitionKey"); string returnedDefinitionName = from(content).getString("[0].processDefinitionName"); int returnedDefinitionVersion = from(content).getInt("[0].processDefinitionVersion"); int returnedTTL = from(content).getInt("[0].historyTimeToLive"); long returnedFinishedCount = from(content).getLong("[0].finishedProcessInstanceCount"); long returnedCleanableCount = from(content).getLong("[0].cleanableProcessInstanceCount"); string returnedTenantId = from(content).getString("[0].tenantId"); Assert.assertEquals(EXAMPLE_PROCESS_DEFINITION_ID, returnedDefinitionId); Assert.assertEquals(EXAMPLE_PD_KEY, returnedDefinitionKey); Assert.assertEquals(EXAMPLE_PD_NAME, returnedDefinitionName); Assert.assertEquals(EXAMPLE_PD_VERSION, returnedDefinitionVersion); Assert.assertEquals(EXAMPLE_TTL, returnedTTL); Assert.assertEquals(EXAMPLE_FINISHED_PI_COUNT, returnedFinishedCount); Assert.assertEquals(EXAMPLE_CLEANABLE_PI_COUNT, returnedCleanableCount); Assert.assertEquals(EXAMPLE_TENANT_ID, returnedTenantId); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testExecutionRetrieval() public virtual void testExecutionRetrieval() { string queryKey = "key"; Response response = given().queryParam("processDefinitionKey", queryKey).then().expect().statusCode(Status.OK.StatusCode).when().get(EXECUTION_QUERY_URL); // assert query invocation InOrder inOrder = Mockito.inOrder(mockedQuery); inOrder.verify(mockedQuery).processDefinitionKey(queryKey); inOrder.verify(mockedQuery).list(); string content = response.asString(); IList <string> executions = from(content).getList(""); Assert.assertEquals("There should be one execution returned.", 1, executions.Count); Assert.assertNotNull("There should be one execution returned", executions[0]); string returnedExecutionId = from(content).getString("[0].id"); bool? returnedIsEnded = from(content).getBoolean("[0].ended"); string returnedProcessInstanceId = from(content).getString("[0].processInstanceId"); string returnedTenantId = from(content).getString("[0].tenantId"); Assert.assertEquals(MockProvider.EXAMPLE_EXECUTION_ID, returnedExecutionId); Assert.assertEquals(MockProvider.EXAMPLE_EXECUTION_IS_ENDED, returnedIsEnded); Assert.assertEquals(MockProvider.EXAMPLE_PROCESS_INSTANCE_ID, returnedProcessInstanceId); Assert.assertEquals(MockProvider.EXAMPLE_TENANT_ID, returnedTenantId); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testSortingParameters() public virtual void testSortingParameters() { InOrder inOrder = Mockito.inOrder(mockedQuery); executeAndVerifySorting("variableName", "asc", Status.OK); inOrder.verify(mockedQuery).orderByVariableName(); inOrder.verify(mockedQuery).asc(); inOrder = Mockito.inOrder(mockedQuery); executeAndVerifySorting("variableType", "desc", Status.OK); inOrder.verify(mockedQuery).orderByVariableType(); inOrder.verify(mockedQuery).desc(); inOrder = Mockito.inOrder(mockedQuery); executeAndVerifySorting("activityInstanceId", "asc", Status.OK); inOrder.verify(mockedQuery).orderByActivityInstanceId(); inOrder.verify(mockedQuery).asc(); inOrder = Mockito.inOrder(mockedQuery); executeAndVerifySorting("activityInstanceId", "desc", Status.OK); inOrder.verify(mockedQuery).orderByActivityInstanceId(); inOrder.verify(mockedQuery).desc(); inOrder = Mockito.inOrder(mockedQuery); executeAndVerifySorting("tenantId", "asc", Status.OK); inOrder.verify(mockedQuery).orderByTenantId(); inOrder.verify(mockedQuery).asc(); inOrder = Mockito.inOrder(mockedQuery); executeAndVerifySorting("tenantId", "desc", Status.OK); inOrder.verify(mockedQuery).orderByTenantId(); inOrder.verify(mockedQuery).desc(); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: private void verifyCRSStructure(org.neo4j.graphdb.spatial.CRS crs) throws java.io.IOException private void VerifyCRSStructure(CRS crs) { // When _jsonCodec.writeValue(_jsonGenerator, crs); // Then verify in order InOrder inOrder = Mockito.inOrder(_jsonGenerator); // Start CRS object inOrder.verify(_jsonGenerator).writeStartObject(); // Code inOrder.verify(_jsonGenerator).writeFieldName("srid"); inOrder.verify(_jsonGenerator).writeNumber(crs.Code); // Name inOrder.verify(_jsonGenerator).writeFieldName("name"); inOrder.verify(_jsonGenerator).writeString(crs.Type); // Type inOrder.verify(_jsonGenerator).writeFieldName("type"); inOrder.verify(_jsonGenerator).writeString("link"); // Properties inOrder.verify(_jsonGenerator).writeFieldName("properties"); // Properties object inOrder.verify(_jsonGenerator).writeStartObject(); inOrder.verify(_jsonGenerator).writeFieldName("href"); inOrder.verify(_jsonGenerator).writeString(startsWith(crs.Href)); inOrder.verify(_jsonGenerator).writeFieldName("type"); inOrder.verify(_jsonGenerator).writeString("ogcwkt"); // Close both properties and CRS objects inOrder.verify(_jsonGenerator, times(2)).writeEndObject(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testGetReport() public virtual void testGetReport() { given().then().expect().statusCode(Status.OK.StatusCode).contentType(ContentType.JSON).when().get(HISTORIC_REPORT_URL); InOrder inOrder = Mockito.inOrder(historicBatchReport); inOrder.verify(historicBatchReport).list(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testActivityStatisticsIncidentsForTypeTypeOption() public virtual void testActivityStatisticsIncidentsForTypeTypeOption() { given().pathParam("id", "aDefinitionId").queryParam("incidentsForType", "failedJob").then().expect().statusCode(Status.OK.StatusCode).when().get(ACTIVITY_STATISTICS_URL); InOrder inOrder = Mockito.inOrder(activityQueryMock); inOrder.verify(activityQueryMock).includeIncidentsForType("failedJob"); inOrder.verify(activityQueryMock).list(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testActivityStatisticsWithFailedJobs() public virtual void testActivityStatisticsWithFailedJobs() { given().pathParam("id", "aDefinitionId").queryParam("failedJobs", "true").then().expect().statusCode(Status.OK.StatusCode).when().get(ACTIVITY_STATISTICS_URL); InOrder inOrder = Mockito.inOrder(activityQueryMock); inOrder.verify(activityQueryMock).includeFailedJobs(); inOrder.verify(activityQueryMock).list(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void sortByName() public virtual void sortByName() { given().queryParam("sortBy", "name").queryParam("sortOrder", "desc").then().expect().statusCode(Status.OK.StatusCode).when().get(QUERY_URL); InOrder inOrder = Mockito.inOrder(mockQuery); inOrder.verify(mockQuery).orderByTenantName(); inOrder.verify(mockQuery).desc(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testGetReport() public virtual void testGetReport() { given().then().expect().statusCode(Status.OK.StatusCode).contentType(ContentType.JSON).when().get(HISTORIC_REPORT_URL); InOrder inOrder = Mockito.inOrder(historicProcessInstanceReport); inOrder.verify(historicProcessInstanceReport).list(); verifyNoMoreInteractions(historicProcessInstanceReport); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testAdditionalIncidentsForTypeOption() public virtual void testAdditionalIncidentsForTypeOption() { given().queryParam("incidentsForType", "failedJob").then().expect().statusCode(Status.OK.StatusCode).when().get(PROCESS_DEFINITION_STATISTICS_URL); InOrder inOrder = Mockito.inOrder(processDefinitionStatisticsQueryMock); inOrder.verify(processDefinitionStatisticsQueryMock).includeIncidentsForType("failedJob"); inOrder.verify(processDefinitionStatisticsQueryMock).list(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testProcessDefinitionStatisticsWithRootIncidents() public virtual void testProcessDefinitionStatisticsWithRootIncidents() { given().queryParam("rootIncidents", "true").then().expect().statusCode(Status.OK.StatusCode).when().get(PROCESS_DEFINITION_STATISTICS_URL); InOrder inOrder = Mockito.inOrder(processDefinitionStatisticsQueryMock); inOrder.verify(processDefinitionStatisticsQueryMock).includeRootIncidents(); inOrder.verify(processDefinitionStatisticsQueryMock).list(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testActivityStatisticsIncidentsForTypeTypeOptionByKey() public virtual void testActivityStatisticsIncidentsForTypeTypeOptionByKey() { given().pathParam("key", MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY).queryParam("incidentsForType", "failedJob").then().expect().statusCode(Status.OK.StatusCode).when().get(ACTIVITY_STATISTICS_BY_KEY_URL); InOrder inOrder = Mockito.inOrder(activityQueryMock); inOrder.verify(activityQueryMock).includeIncidentsForType("failedJob"); inOrder.verify(activityQueryMock).list(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testAdditionalCompleteScopeOption() public virtual void testAdditionalCompleteScopeOption() { given().pathParam("id", MockProvider.EXAMPLE_PROCESS_DEFINITION_ID).queryParam("completeScope", "true").then().expect().statusCode(Status.OK.StatusCode).when().get(HISTORIC_ACTIVITY_STATISTICS_URL); InOrder inOrder = Mockito.inOrder(historicActivityStatisticsQuery); inOrder.verify(historicActivityStatisticsQuery).includeCompleteScope(); inOrder.verify(historicActivityStatisticsQuery).list(); inOrder.verifyNoMoreInteractions(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testCaseDefinitionRetrievalByEmptyList() public virtual void testCaseDefinitionRetrievalByEmptyList() { given().queryParam("caseDefinitionIdIn", "").then().expect().statusCode(Status.OK.StatusCode).when().get(CASE_DEFINITION_QUERY_URL); // assert query invocation InOrder inOrder = Mockito.inOrder(mockedQuery); inOrder.verify(mockedQuery, never()).caseDefinitionIdIn(Matchers.anyVararg <string[]>()); inOrder.verify(mockedQuery).list(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testDecisionRequirementsDefinitionRetrievalByEmptyList() public virtual void testDecisionRequirementsDefinitionRetrievalByEmptyList() { given().queryParam("decisionRequirementsDefinitionIdIn", "").then().expect().statusCode(Status.OK.StatusCode).when().get(DECISION_REQUIREMENTS_DEFINITION_QUERY_URL); // assert query invocation InOrder inOrder = Mockito.inOrder(mockedQuery); inOrder.verify(mockedQuery, never()).decisionRequirementsDefinitionIdIn(Matchers.anyVararg <string[]>()); inOrder.verify(mockedQuery).list(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testPOSTQuerySorting() public virtual void testPOSTQuerySorting() { InOrder inOrder = Mockito.inOrder(mockQuery); executeAndVerifyPOSTSorting(OrderingBuilder.create().orderBy("processDefinitionKey").desc().orderBy("lockExpirationTime").asc().Json, Status.OK); inOrder.verify(mockQuery).orderByProcessDefinitionKey(); inOrder.verify(mockQuery).desc(); inOrder.verify(mockQuery).orderByLockExpirationTime(); inOrder.verify(mockQuery).asc(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testSortingParameters() public virtual void testSortingParameters() { InOrder inOrder = Mockito.inOrder(mockedQuery); executeAndVerifySuccessfulSorting("category", "asc", Status.OK); inOrder.verify(mockedQuery).orderByProcessDefinitionCategory(); inOrder.verify(mockedQuery).asc(); inOrder = Mockito.inOrder(mockedQuery); executeAndVerifySuccessfulSorting("key", "desc", Status.OK); inOrder.verify(mockedQuery).orderByProcessDefinitionKey(); inOrder.verify(mockedQuery).desc(); inOrder = Mockito.inOrder(mockedQuery); executeAndVerifySuccessfulSorting("id", "asc", Status.OK); inOrder.verify(mockedQuery).orderByProcessDefinitionId(); inOrder.verify(mockedQuery).asc(); inOrder = Mockito.inOrder(mockedQuery); executeAndVerifySuccessfulSorting("version", "desc", Status.OK); inOrder.verify(mockedQuery).orderByProcessDefinitionVersion(); inOrder.verify(mockedQuery).desc(); inOrder = Mockito.inOrder(mockedQuery); executeAndVerifySuccessfulSorting("name", "asc", Status.OK); inOrder.verify(mockedQuery).orderByProcessDefinitionName(); inOrder.verify(mockedQuery).asc(); inOrder = Mockito.inOrder(mockedQuery); executeAndVerifySuccessfulSorting("deploymentId", "desc", Status.OK); inOrder.verify(mockedQuery).orderByDeploymentId(); inOrder.verify(mockedQuery).desc(); inOrder = Mockito.inOrder(mockedQuery); executeAndVerifySuccessfulSorting("tenantId", "asc", Status.OK); inOrder.verify(mockedQuery).orderByTenantId(); inOrder.verify(mockedQuery).asc(); inOrder = Mockito.inOrder(mockedQuery); executeAndVerifySuccessfulSorting("tenantId", "desc", Status.OK); inOrder.verify(mockedQuery).orderByTenantId(); inOrder.verify(mockedQuery).desc(); inOrder = Mockito.inOrder(mockedQuery); executeAndVerifySuccessfulSorting("versionTag", "asc", Status.OK); inOrder.verify(mockedQuery).orderByVersionTag(); inOrder.verify(mockedQuery).asc(); inOrder = Mockito.inOrder(mockedQuery); executeAndVerifySuccessfulSorting("versionTag", "desc", Status.OK); inOrder.verify(mockedQuery).orderByVersionTag(); inOrder.verify(mockedQuery).asc(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testSecondarySortingAsPost() public virtual void testSecondarySortingAsPost() { InOrder inOrder = Mockito.inOrder(mockedQuery); IDictionary <string, object> json = new Dictionary <string, object>(); json["sorting"] = OrderingBuilder.create().orderBy("variableName").desc().orderBy("activityInstanceId").asc().Json; given().contentType(POST_JSON_CONTENT_TYPE).body(json).header("accept", MediaType.APPLICATION_JSON).then().expect().statusCode(Status.OK.StatusCode).when().post(VARIABLE_INSTANCE_QUERY_URL); inOrder.verify(mockedQuery).orderByVariableName(); inOrder.verify(mockedQuery).desc(); inOrder.verify(mockedQuery).orderByActivityInstanceId(); inOrder.verify(mockedQuery).asc(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testSecondarySortingAsPost() public virtual void testSecondarySortingAsPost() { InOrder inOrder = Mockito.inOrder(mockedQuery); IDictionary <string, object> json = new Dictionary <string, object>(); json["sorting"] = OrderingBuilder.create().orderBy("processInstanceId").desc().orderBy("timestamp").asc().Json; given().contentType(POST_JSON_CONTENT_TYPE).body(json).header("accept", MediaType.APPLICATION_JSON).then().expect().statusCode(Status.OK.StatusCode).when().post(HISTORIC_EXTERNAL_TASK_LOG_RESOURCE_URL); inOrder.verify(mockedQuery).orderByProcessInstanceId(); inOrder.verify(mockedQuery).desc(); inOrder.verify(mockedQuery).orderByTimestamp(); inOrder.verify(mockedQuery).asc(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testSecondarySortingAsPost() public virtual void testSecondarySortingAsPost() { InOrder inOrder = Mockito.inOrder(mockQuery); IDictionary <string, object> json = new Dictionary <string, object>(); json["sorting"] = OrderingBuilder.create().orderBy("jobRetries").desc().orderBy("jobDueDate").asc().Json; given().contentType(POST_JSON_CONTENT_TYPE).body(json).header("accept", MediaType.APPLICATION_JSON).then().expect().statusCode(Status.OK.StatusCode).when().post(JOBS_RESOURCE_URL); inOrder.verify(mockQuery).orderByJobRetries(); inOrder.verify(mockQuery).desc(); inOrder.verify(mockQuery).orderByJobDuedate(); inOrder.verify(mockQuery).asc(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testSecondarySortingAsPost() public virtual void testSecondarySortingAsPost() { InOrder inOrder = Mockito.inOrder(mockedQuery); IDictionary <string, object> json = new Dictionary <string, object>(); json["sorting"] = OrderingBuilder.create().orderBy("definitionKey").desc().orderBy("instanceId").asc().Json; given().contentType(POST_JSON_CONTENT_TYPE).body(json).header("accept", MediaType.APPLICATION_JSON).then().expect().statusCode(Status.OK.StatusCode).when().post(EXECUTION_QUERY_URL); inOrder.verify(mockedQuery).orderByProcessDefinitionKey(); inOrder.verify(mockedQuery).desc(); inOrder.verify(mockedQuery).orderByProcessInstanceId(); inOrder.verify(mockedQuery).asc(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testAdditionalFinishedBeforeOption() public virtual void testAdditionalFinishedBeforeOption() { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final java.util.Date testDate = new java.util.Date(0); DateTime testDate = new DateTime(); given().pathParam("id", MockProvider.EXAMPLE_PROCESS_DEFINITION_ID).queryParam("finishedBefore", DATE_FORMAT_WITH_TIMEZONE.format(testDate)).then().expect().statusCode(Status.OK.StatusCode).when().get(HISTORIC_ACTIVITY_STATISTICS_URL); InOrder inOrder = Mockito.inOrder(historicActivityStatisticsQuery); inOrder.verify(historicActivityStatisticsQuery).finishedBefore(testDate); inOrder.verify(historicActivityStatisticsQuery).list(); inOrder.verifyNoMoreInteractions(); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testCaseExecutionRetrievalAsPost() public virtual void testCaseExecutionRetrievalAsPost() { string queryCaseExecutionId = "aCaseExecutionId"; IDictionary <string, string> queryParameter = new Dictionary <string, string>(); queryParameter["caseExecutionId"] = queryCaseExecutionId; Response response = given().contentType(POST_JSON_CONTENT_TYPE).body(queryParameter).then().expect().statusCode(Status.OK.StatusCode).when().post(CASE_EXECUTION_QUERY_URL); // assert query invocation InOrder inOrder = Mockito.inOrder(mockedQuery); inOrder.verify(mockedQuery).caseExecutionId(queryCaseExecutionId); inOrder.verify(mockedQuery).list(); string content = response.asString(); IList <IDictionary <string, string> > caseExecutions = from(content).getList(""); assertThat(caseExecutions).hasSize(1); assertThat(caseExecutions[0]).NotNull; string returnedId = from(content).getString("[0].id"); string returnedCaseInstanceId = from(content).getString("[0].caseInstanceId"); string returnedParentId = from(content).getString("[0].parentId"); string returnedCaseDefinitionId = from(content).getString("[0].caseDefinitionId"); string returnedActivityId = from(content).getString("[0].activityId"); string returnedActivityName = from(content).getString("[0].activityName"); string returnedActivityType = from(content).getString("[0].activityType"); string returnedActivityDescription = from(content).getString("[0].activityDescription"); string returnedTenantId = from(content).getString("[0].tenantId"); bool returnedRequired = from(content).getBoolean("[0].required"); bool returnedActiveState = from(content).getBoolean("[0].active"); bool returnedEnabledState = from(content).getBoolean("[0].enabled"); bool returnedDisabledState = from(content).getBoolean("[0].disabled"); assertThat(returnedId).isEqualTo(MockProvider.EXAMPLE_CASE_EXECUTION_ID); assertThat(returnedCaseInstanceId).isEqualTo(MockProvider.EXAMPLE_CASE_EXECUTION_CASE_INSTANCE_ID); assertThat(returnedParentId).isEqualTo(MockProvider.EXAMPLE_CASE_EXECUTION_PARENT_ID); assertThat(returnedCaseDefinitionId).isEqualTo(MockProvider.EXAMPLE_CASE_EXECUTION_CASE_DEFINITION_ID); assertThat(returnedActivityId).isEqualTo(MockProvider.EXAMPLE_CASE_EXECUTION_ACTIVITY_ID); assertThat(returnedActivityName).isEqualTo(MockProvider.EXAMPLE_CASE_EXECUTION_ACTIVITY_NAME); assertThat(returnedActivityType).isEqualTo(MockProvider.EXAMPLE_CASE_EXECUTION_ACTIVITY_TYPE); assertThat(returnedActivityDescription).isEqualTo(MockProvider.EXAMPLE_CASE_EXECUTION_ACTIVITY_DESCRIPTION); assertThat(returnedTenantId).isEqualTo(MockProvider.EXAMPLE_TENANT_ID); assertThat(returnedRequired).isEqualTo(MockProvider.EXAMPLE_CASE_EXECUTION_IS_REQUIRED); assertThat(returnedEnabledState).isEqualTo(MockProvider.EXAMPLE_CASE_EXECUTION_IS_ENABLED); assertThat(returnedActiveState).isEqualTo(MockProvider.EXAMPLE_CASE_EXECUTION_IS_ACTIVE); assertThat(returnedDisabledState).isEqualTo(MockProvider.EXAMPLE_CASE_EXECUTION_IS_DISABLED); }