//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testSetDateVariable() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: public virtual void testSetDateVariable() { string variableValue = testDateFormat.format(testDate); IDictionary <string, object> variableJson = VariablesBuilder.getVariableValueMap(variableValue, "Date"); given().pathParam("id", EXAMPLE_PROCESS_INSTANCE_ID).pathParam("varId", EXAMPLE_VARIABLE_KEY).contentType(ContentType.JSON).body(variableJson).then().expect().statusCode(Status.NO_CONTENT.StatusCode).when().put(SINGLE_PROCESS_INSTANCE_VARIABLE_URL); verify(runtimeServiceMock).setVariable(eq(EXAMPLE_PROCESS_INSTANCE_ID), eq(EXAMPLE_VARIABLE_KEY), argThat(EqualsPrimitiveValue.dateValue(testDate))); }
//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(); }
//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))); }
//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(); }