SPIRoutingHook implements RoutingHook { @Override public void finishFailure(final Exception cause) { for (RoutingHook each : routingHooks) { each.finishFailure(cause); } }  @Override void start(final String sql); @Override void finishSuccess(final RouteContext routeContext, final SchemaMetaData schemaMetaData); @Override void finishFailure(final Exception cause);  }
@Test public void assertFinishFailure() { spiRoutingHook.finishFailure(exception); RoutingHook routingHook = getFixtureHook(); assertThat(routingHook, instanceOf(RoutingHookFixture.class)); assertThat(((RoutingHookFixture) routingHook).getCause(), is(exception)); }