Example #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testCreateCaseInstanceByCaseDefinitionIdWithVariables()
        public virtual void testCreateCaseInstanceByCaseDefinitionIdWithVariables()
        {
            IDictionary <string, object> variables = new Dictionary <string, object>();

            variables["aVariableName"]       = VariablesBuilder.getVariableValueMap("abc", ValueType.STRING.Name);
            variables["anotherVariableName"] = VariablesBuilder.getVariableValueMap(900, ValueType.INTEGER.Name);

            IDictionary <string, object> @params = new Dictionary <string, object>();

            @params["variables"] = variables;

            given().pathParam("id", MockProvider.EXAMPLE_CASE_DEFINITION_ID).contentType(POST_JSON_CONTENT_TYPE).body(@params).then().expect().statusCode(Status.OK.StatusCode).body("id", equalTo(MockProvider.EXAMPLE_CASE_INSTANCE_ID)).when().post(CREATE_INSTANCE_URL);

            verify(caseServiceMock).withCaseDefinition(MockProvider.EXAMPLE_CASE_DEFINITION_ID);
            verify(caseInstanceBuilder).businessKey(null);
            verify(caseInstanceBuilder).Variables = argThat(EqualsVariableMap.matches().matcher("aVariableName", EqualsPrimitiveValue.stringValue("abc")).matcher("anotherVariableName", EqualsPrimitiveValue.integerValue(900)));
            verify(caseInstanceBuilder).create();
        }
Example #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testCreateCaseInstanceByCaseDefinitionKeyWithBusinessKeyAndVariables()
        public virtual void testCreateCaseInstanceByCaseDefinitionKeyWithBusinessKeyAndVariables()
        {
            IDictionary <string, object> variables = new Dictionary <string, object>();

            variables["aVariableName"]       = VariablesBuilder.getVariableValueMap("abc", null);
            variables["anotherVariableName"] = VariablesBuilder.getVariableValueMap(900, null);

            IDictionary <string, object> @params = new Dictionary <string, object>();

            @params["variables"]   = variables;
            @params["businessKey"] = "aBusinessKey";

            given().pathParam("key", MockProvider.EXAMPLE_CASE_DEFINITION_KEY).contentType(POST_JSON_CONTENT_TYPE).body(@params).then().expect().statusCode(Status.OK.StatusCode).body("id", equalTo(MockProvider.EXAMPLE_CASE_INSTANCE_ID)).when().post(CREATE_INSTANCE_BY_KEY_URL);

            IDictionary <string, object> expectedVariables = new Dictionary <string, object>();

            expectedVariables["aVariableName"]       = "abc";
            expectedVariables["anotherVariableName"] = 999;

            verify(caseServiceMock).withCaseDefinition(MockProvider.EXAMPLE_CASE_DEFINITION_ID);
            verify(caseInstanceBuilder).businessKey("aBusinessKey");
            verify(caseInstanceBuilder).Variables = argThat(EqualsVariableMap.matches().matcher("aVariableName", EqualsUntypedValue.matcher().value("abc")).matcher("anotherVariableName", EqualsUntypedValue.matcher().value(900)));
            verify(caseInstanceBuilder).create();
        }