private void cleanupAutoGeneratedKeyPairs(Set<Integer> generatedSshKeyIds) { logger.debug(">> cleaning up auto-generated key pairs..."); for (Integer sshKeyId : generatedSshKeyIds) { try { api.keyApi().delete(sshKeyId); } catch (Exception ex) { logger.warn(">> could not delete key pair %s: %s", sshKeyId, ex.getMessage()); } } }
private void cleanupAutoGeneratedKeyPairs(Set<Integer> generatedSshKeyIds) { logger.debug(">> cleaning up auto-generated key pairs..."); for (Integer sshKeyId : generatedSshKeyIds) { try { api.keyApi().delete(sshKeyId); } catch (Exception ex) { logger.warn(">> could not delete key pair %s: %s", sshKeyId, ex.getMessage()); } } }
private void cleanupAutoGeneratedKeyPairs(Set<Integer> generatedSshKeyIds) { logger.debug(">> cleaning up auto-generated key pairs..."); for (Integer sshKeyId : generatedSshKeyIds) { try { api.keyApi().delete(sshKeyId); } catch (Exception ex) { logger.warn(">> could not delete key pair %s: %s", sshKeyId, ex.getMessage()); } } }
@AfterClass(alwaysRun = true) public void tearDown() { if (key != null) { api.keyApi().delete(key.id()); } }
public void testDeleteKeyReturns404() throws InterruptedException { server.enqueue(response404()); api.keyApi().delete(1); assertEquals(server.getRequestCount(), 1); assertSent(server, "DELETE", "/account/keys/1"); }
public void testDeleteKeyUsingfingerprintReturns404() throws InterruptedException { server.enqueue(response404()); api.keyApi().delete("1a:cc:9b:88:c8:4f:b8:77:96:15:d2:0c:95:86:ff:90"); assertEquals(server.getRequestCount(), 1); assertSent(server, "DELETE", "/account/keys/1a:cc:9b:88:c8:4f:b8:77:96:15:d2:0c:95:86:ff:90"); }
public void testDeleteKey() throws InterruptedException { server.enqueue(response204()); api.keyApi().delete(1); assertEquals(server.getRequestCount(), 1); assertSent(server, "DELETE", "/account/keys/1"); }
public void testDeleteKeyUsingFingerprint() throws InterruptedException { server.enqueue(response204()); api.keyApi().delete("1a:cc:9b:88:c8:4f:b8:77:96:15:d2:0c:95:86:ff:90"); assertEquals(server.getRequestCount(), 1); assertSent(server, "DELETE", "/account/keys/1a:cc:9b:88:c8:4f:b8:77:96:15:d2:0c:95:86:ff:90"); }
@AfterClass(alwaysRun = true) public void testDeleteKey() { if (dsa != null) { api().delete(dsa.id()); FluentIterable<Key> keys = api().list().concat(); assertFalse(keys.contains(dsa), "dsa key must not be present in list"); } if (ecdsa != null) { api().delete(ecdsa.fingerprint()); FluentIterable<Key> keys = api().list().concat(); assertFalse(keys.contains(ecdsa), "dsa key must not be present in list"); } }