@Test
public void testGetVariableForNonExistingInstance() {
String variableKey = "aVariableKey";
when(caseServiceMock.getVariableTyped(eq(MockProvider.EXAMPLE_CASE_INSTANCE_ID), eq(variableKey), eq(true)))
.thenThrow(new ProcessEngineException("expected exception"));
given().pathParam("id", MockProvider.EXAMPLE_CASE_INSTANCE_ID).pathParam("varId", variableKey)
.then().expect().statusCode(Status.INTERNAL_SERVER_ERROR.getStatusCode())
.body("type", is(RestException.class.getSimpleName()))
.body("message", is("Cannot get case execution variable " + variableKey + ": expected exception"))