RoutingDockerRunner extends AbstractRoutingRunner<DockerRunner> implements DockerRunner { @Override public void cleanup() throws IOException { for (var v: runners.values()) { v.cleanup(); } } RoutingDockerRunner(DockerRunnerFactory dockerRunnerFactory, Function<RunState, String> runnerId); @Override String start(RunState runState, RunSpec runSpec); @Override void poll(RunState runState); @Override void cleanup();  }
@Test public void testCleanup() throws Exception { dockerRunner.start(runState, runSpec); dockerRunner.cleanup(); assertThatCreateCountersContains("default"); verify(createdRunners.get("default")).cleanup(); }