@Test
public void testGetEventOperation() throws Exception {

  String eventMetadataString = IOUtils.toString(getClass().getResource("/eventOperation.json"));
  String path = "{eventId}/workflows/{workflowId}/operations/{operationPosition}";
  given().pathParam("eventId", "notExists").pathParam("workflowId", "notExists").pathParam("operationPosition", "1")
          .expect().statusCode(HttpStatus.SC_NOT_FOUND).when().get(rt.host(path));
  given().pathParam("eventId", "asdasd").pathParam("workflowId", "xxxx").pathParam("operationPosition", "1").expect()
          .statusCode(HttpStatus.SC_BAD_REQUEST).when().get(rt.host(path));
  given().pathParam("eventId", "asdasd").pathParam("workflowId", "9999").pathParam("operationPosition", "1").expect()
          .statusCode(HttpStatus.SC_NOT_FOUND).when().get(rt.host(path));
  // found but invalid operation position - its null
  given().pathParam("eventId", "asdasd").pathParam("workflowId", "9999").pathParam("operationPosition", "99").expect()
          .statusCode(HttpStatus.SC_NOT_FOUND).when().get(rt.host(path));
  String result = given().pathParam("eventId", "asdasd").pathParam("workflowId", "1")
          .pathParam("operationPosition", "1").expect().statusCode(HttpStatus.SC_OK).when().get(rt.host(path))
          .asString();
  assertThat(eventMetadataString, SameJSONAs.sameJSONAs(result));
}