SshKeyAdditionWorkflow extends CancellableWorkflow<SshKeyAdditionWorkflow.SshKeyAdditionPhase> { public SshKeyAdditionPhase ADD_KEY() { operationTracker.addLog( "Adding ssh key to containers" ); try { environment.addSshKey( sshKey ); new AddSshKeyStep( sshKey, environment, operationTracker ).execute(); saveEnvironment(); return SshKeyAdditionPhase.FINALIZE; } catch ( Exception e ) { fail( e.getMessage(), e ); return null; } } SshKeyAdditionWorkflow( final LocalEnvironment environment, final String sshKey,
                                   final TrackerOperation operationTracker,
                                   final EnvironmentManagerImpl environmentManager ); SshKeyAdditionPhase INIT(); SshKeyAdditionPhase ADD_KEY(); void FINALIZE(); @Override void fail( final String message, final Throwable e ); @Override void onCancellation();  }
@Test public void testADD_KEY() throws Exception { workflow.ADD_KEY(); verify( environmentManager, atLeastOnce() ).update( environment ); }