### Question:
GcpRuntimeSSHKey extends ChaosSSHCredentials { public GcpSSHKeyMetadata getSshKeyMetadata () { return sshKeyMetadata; } GcpRuntimeSSHKey(); GcpSSHKeyMetadata getSshKeyMetadata(); static final String CHAOS_USERNAME; }### Answer:
@Test public void getSshKeyMetadata () { GcpSSHKeyMetadata actual = gcpRuntimeSSHKey.getSshKeyMetadata(); assertTrue(gcpRuntimeSSHKey.getSSHKeys() .keySet() .stream() .map(pub -> new Buffer.PlainBuffer().putPublicKey(pub).getCompactData()) .map(bytes -> Base64.getEncoder().encodeToString(bytes)) .anyMatch(s -> actual.getPublicKey().equals(s))); assertEquals("chaosengine", actual.getUsername()); }
@Test public void fieldNullCheck () { assertNotNull(gcpRuntimeSSHKey.getSshKeyMetadata()); assertNotNull(gcpRuntimeSSHKey.getUsername()); assertNotNull(gcpRuntimeSSHKey.getSSHKeys()); assertNull("GCP does not use passwords, should not have a password generator", gcpRuntimeSSHKey.getPasswordGenerator()); }