RenameContainerTask extends TaskUtil.Task<Object> { @Override public EnvironmentContainerImpl call() throws Exception { EnvironmentContainerImpl environmentContainer = ( EnvironmentContainerImpl ) environment.getContainerHostById( containerId.getId() ); oldHostname = environmentContainer.getHostname(); return ( EnvironmentContainerImpl ) environmentContainer.setHostname( newHostname, false ); } RenameContainerTask( final LocalEnvironment environment, final HostId containerId, final String newHostname ); @Override EnvironmentContainerImpl call(); String getOldHostname(); String getNewHostname();  }
@Test public void testCall() throws Exception { task.call(); verify( environmentContainer ).setHostname( anyString(), eq( false ) ); }