@Test
public void testJavaObjectVariableSerialization() {
when(caseServiceMock.getVariablesTyped(MockProvider.EXAMPLE_CASE_INSTANCE_ID, true)).thenReturn(EXAMPLE_OBJECT_VARIABLES);
Response response = given().pathParam("id", MockProvider.EXAMPLE_CASE_INSTANCE_ID)
.then().expect().statusCode(Status.OK.getStatusCode())
.body(EXAMPLE_VARIABLE_KEY, notNullValue())
.body(EXAMPLE_VARIABLE_KEY + ".value.property1", equalTo("aPropertyValue"))
.body(EXAMPLE_VARIABLE_KEY + ".value.property2", equalTo(true))
.body(EXAMPLE_VARIABLE_KEY + ".type", equalTo(VariableTypeHelper.toExpectedValueTypeName(ValueType.OBJECT)))
.body(EXAMPLE_VARIABLE_KEY + ".valueInfo." + ObjectTypeImpl.VALUE_INFO_OBJECT_TYPE_NAME, equalTo(ExampleVariableObject.class.getName()))
.body(EXAMPLE_VARIABLE_KEY + ".valueInfo." + ObjectTypeImpl.VALUE_INFO_SERIALIZATION_DATA_FORMAT, equalTo("application/json"))
.when().get(CASE_INSTANCE_VARIABLES_URL);
Assert.assertEquals("Should return exactly one variable", 1, response.jsonPath().getMap("").size());
verify(caseServiceMock).getVariablesTyped(MockProvider.EXAMPLE_CASE_INSTANCE_ID, true);
}