RoutingProcedureResponse { public boolean isSuccess() { return records != null; } RoutingProcedureResponse(Query procedure, List<Record> records );  RoutingProcedureResponse(Query procedure, Throwable error ); private  RoutingProcedureResponse(Query procedure, List<Record> records, Throwable error ); boolean isSuccess(); Query procedure(); List<Record> records(); Throwable error();  }
@Test void shouldBeSuccessfulWithRecords() { RoutingProcedureResponse response = new RoutingProcedureResponse( PROCEDURE, asList( RECORD_1, RECORD_2 ) ); assertTrue( response.isSuccess() ); }
@Test void shouldNotBeSuccessfulWithError() { RoutingProcedureResponse response = new RoutingProcedureResponse( PROCEDURE, new RuntimeException() ); assertFalse( response.isSuccess() ); }