public void testExecuteWithDefaultOptionsAlreadyHasKey() throws SecurityException, NoSuchMethodException {
// setup constants
URI org = URI.create("org1");
String identity = "identity";
String group = "group";
TerremarkVCloudTemplateOptions options = new TerremarkVCloudTemplateOptions();
// create mocks
CreateNewKeyPairUnlessUserSpecifiedOtherwise strategy = setupStrategy();
LoginCredentials keyPairCredentials = LoginCredentials.builder().privateKey(KeyPairHandlerTest.keyPair.getPrivateKey()).build();
// setup expectations
expect(strategy.credentialStore.containsKey("group#group")).andReturn(true);
expect(strategy.credentialStore.get("group#group")).andReturn(keyPairCredentials);
// replay mocks
replayStrategy(strategy);
// run
strategy.execute(org, group, identity, options);
assertEquals(options.getSshKeyFingerprint(), KeyPairHandlerTest.keyPair.getFingerPrint());
// verify mocks
verifyStrategy(strategy);
}