@Test
public void testChangeContainerHostname() throws Exception
{

    HostnameModificationWorkflow hostnameModificationWorkflow = mock( HostnameModificationWorkflow.class );
    doReturn( hostnameModificationWorkflow ).when( environmentManager )
                                            .getHostnameModificationWorkflow( environment, TestHelper.CONT_HOST_ID,
                                                    "new", trackerOperation );
    doNothing().when( environmentManager ).registerActiveWorkflow( environment, hostnameModificationWorkflow );
    environmentManager.changeContainerHostname( TestHelper.CONT_HOST_ID, "new", false );
    verify( hostnameModificationWorkflow ).join();
    //-----
    doReturn( true ).when( hostnameModificationWorkflow ).isFailed();
    try
    {
        environmentManager.changeContainerHostname( TestHelper.CONT_HOST_ID, "new", false );
        fail( "Expected EnvironmentModificationException" );
    }
    catch ( EnvironmentModificationException e )
    {
    }
}