示例#1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testGetSingleVariableInstanceDeserialized()
        public virtual void testGetSingleVariableInstanceDeserialized()
        {
            ObjectValue serializedValue = MockObjectValue.fromObjectValue(Variables.objectValue("a value").serializationDataFormat("aDataFormat").create()).objectTypeName("aTypeName");

            MockHistoricVariableInstanceBuilder builder = MockProvider.mockHistoricVariableInstance().typedValue(serializedValue);
            HistoricVariableInstance            variableInstanceMock = builder.build();

            when(variableInstanceQueryMock.variableId(variableInstanceMock.Id)).thenReturn(variableInstanceQueryMock);
            when(variableInstanceQueryMock.disableBinaryFetching()).thenReturn(variableInstanceQueryMock);
            when(variableInstanceQueryMock.singleResult()).thenReturn(variableInstanceMock);

            given().pathParam("id", MockProvider.EXAMPLE_VARIABLE_INSTANCE_ID).then().expect().statusCode(Status.OK.StatusCode).and().body("id", equalTo(builder.Id)).body("name", equalTo(builder.Name)).body("type", equalTo(VariableTypeHelper.toExpectedValueTypeName(builder.TypedValue.Type))).body("value", equalTo("a value")).body("valueInfo.serializationDataFormat", equalTo("aDataFormat")).body("valueInfo.objectTypeName", equalTo("aTypeName")).body("processDefinitionKey", equalTo(builder.ProcessDefinitionKey)).body("processDefinitionId", equalTo(builder.ProcessDefinitionId)).body("processInstanceId", equalTo(builder.ProcessInstanceId)).body("executionId", equalTo(builder.ExecutionId)).body("errorMessage", equalTo(builder.ErrorMessage)).body("activityInstanceId", equalTo(builder.ActivityInstanceId)).body("caseDefinitionKey", equalTo(builder.CaseDefinitionKey)).body("caseDefinitionId", equalTo(builder.CaseDefinitionId)).body("caseInstanceId", equalTo(builder.CaseInstanceId)).body("caseExecutionId", equalTo(builder.CaseExecutionId)).body("taskId", equalTo(builder.TaskId)).body("tenantId", equalTo(builder.TenantId)).body("createTime", equalTo(MockProvider.EXAMPLE_HISTORIC_VARIABLE_INSTANCE_CREATE_TIME)).body("removalTime", equalTo(MockProvider.EXAMPLE_HISTORIC_VARIABLE_INSTANCE_REMOVAL_TIME)).body("rootProcessInstanceId", equalTo(builder.RootProcessInstanceId)).when().get(VARIABLE_INSTANCE_URL);

            verify(variableInstanceQueryMock, times(1)).disableBinaryFetching();
            verify(variableInstanceQueryMock, never()).disableCustomObjectDeserialization();
        }
示例#2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testGetSingleVariableUpdateDeserialized()
        public virtual void testGetSingleVariableUpdateDeserialized()
        {
            ObjectValue serializedValue = MockObjectValue.fromObjectValue(Variables.objectValue("a value").serializationDataFormat("aDataFormat").create()).objectTypeName("aTypeName");

            MockHistoricVariableUpdateBuilder builder = MockProvider.mockHistoricVariableUpdate().typedValue(serializedValue);
            HistoricVariableUpdate            variableInstanceMock = builder.build();

            when(historicDetailQueryMock.detailId(variableInstanceMock.Id)).thenReturn(historicDetailQueryMock);
            when(historicDetailQueryMock.disableBinaryFetching()).thenReturn(historicDetailQueryMock);
            when(historicDetailQueryMock.singleResult()).thenReturn(variableInstanceMock);

            given().pathParam("id", builder.Id).then().expect().statusCode(Status.OK.StatusCode).and().body("id", equalTo(builder.Id)).body("variableName", equalTo(builder.Name)).body("variableInstanceId", equalTo(builder.VariableInstanceId)).body("variableType", equalTo(VariableTypeHelper.toExpectedValueTypeName(builder.TypedValue.Type))).body("value", equalTo("a value")).body("valueInfo.serializationDataFormat", equalTo("aDataFormat")).body("valueInfo.objectTypeName", equalTo("aTypeName")).body("processDefinitionKey", equalTo(builder.ProcessDefinitionKey)).body("processDefinitionId", equalTo(builder.ProcessDefinitionId)).body("processInstanceId", equalTo(builder.ProcessInstanceId)).body("errorMessage", equalTo(builder.ErrorMessage)).body("activityInstanceId", equalTo(builder.ActivityInstanceId)).body("revision", equalTo(builder.Revision)).body("time", equalTo(builder.Time)).body("taskId", equalTo(builder.TaskId)).body("executionId", equalTo(builder.ExecutionId)).body("caseDefinitionKey", equalTo(builder.CaseDefinitionKey)).body("caseDefinitionId", equalTo(builder.CaseDefinitionId)).body("caseInstanceId", equalTo(builder.CaseInstanceId)).body("caseExecutionId", equalTo(builder.CaseExecutionId)).body("tenantId", equalTo(builder.TenantId)).when().get(HISTORIC_DETAIL_URL);

            verify(historicDetailQueryMock, times(1)).disableBinaryFetching();
            verify(historicDetailQueryMock, never()).disableCustomObjectDeserialization();
        }