RegisterHostsStep { public void execute() throws EnvironmentManagerException, PeerException { if ( !environment.getContainerHosts().isEmpty() && topology.registerHosts() ) { registerHosts( environment.getContainerHosts() ); } } RegisterHostsStep( final Topology topology, final LocalEnvironment environment,
                              final TrackerOperation trackerOperation ); void execute();  }
@Test( expected = EnvironmentManagerException.class ) public void testExecute() throws Exception { doReturn( true ).when( peerTaskResult ).hasSucceeded(); step.execute(); verify( step ).registerHosts( anySet() ); doReturn( false ).when( peerTaskResult ).hasSucceeded(); doReturn( true ).when( peerTaskResults ).hasFailures(); step.execute(); }