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 testMultipleProcessVariableParametersAsPost()
        public virtual void testMultipleProcessVariableParametersAsPost()
        {
            string variableName         = "varName";
            string variableValue        = "varValue";
            string anotherVariableName  = "anotherVarName";
            int?   anotherVariableValue = 30;

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

            variableJson["name"]     = variableName;
            variableJson["operator"] = "eq";
            variableJson["value"]    = variableValue;

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

            anotherVariableJson["name"]     = anotherVariableName;
            anotherVariableJson["operator"] = "neq";
            anotherVariableJson["value"]    = anotherVariableValue;

            IList <IDictionary <string, object> > variables = new List <IDictionary <string, object> >();

            variables.Add(variableJson);
            variables.Add(anotherVariableJson);

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

            json["processVariables"] = variables;

            given().contentType(POST_JSON_CONTENT_TYPE).body(json).then().expect().statusCode(Status.OK.StatusCode).when().post(EXECUTION_QUERY_URL);

            verify(mockedQuery).processVariableValueEquals(variableName, variableValue);
            verify(mockedQuery).processVariableValueNotEquals(eq(anotherVariableName), argThat(EqualsPrimitiveValue.numberValue(anotherVariableValue)));
        }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testMultipleVariableParametersAsPost()
        public virtual void testMultipleVariableParametersAsPost()
        {
            string variableName         = "varName";
            string variableValue        = "varValue";
            string anotherVariableName  = "anotherVarName";
            int?   anotherVariableValue = 30;

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

            variableJson["name"]     = variableName;
            variableJson["operator"] = "eq";
            variableJson["value"]    = variableValue;

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

            anotherVariableJson["name"]     = anotherVariableName;
            anotherVariableJson["operator"] = "neq";
            anotherVariableJson["value"]    = anotherVariableValue;

            IList <IDictionary <string, object> > variables = new List <IDictionary <string, object> >();

            variables.Add(variableJson);
            variables.Add(anotherVariableJson);

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

            json["variableValues"] = variables;

            given().contentType(POST_JSON_CONTENT_TYPE).body(json).then().expect().statusCode(Status.OK.StatusCode).when().post(VARIABLE_INSTANCE_QUERY_URL);

            verify(mockedQuery).variableValueEquals(variableName, variableValue);
            verify(mockedQuery).variableValueNotEquals(eq(anotherVariableName), argThat(EqualsPrimitiveValue.numberValue(anotherVariableValue)));
            verify(mockedQuery).disableBinaryFetching();

            // requirement to not break existing API; should be:
            // verify(variableInstanceQueryMock).disableCustomObjectDeserialization();
            verify(mockedQuery, never()).disableCustomObjectDeserialization();
        }