@Test public void getKeyPairTypeForFileSystemKeyPair() { KeyData keyData = new KeyData(); keyData.setPublicKeyPath(mock(Path.class)); keyData.setPrivateKeyPath(mock(Path.class)); Class<? extends ConfigKeyPair> result = KeyDataUtil.getKeyPairTypeFor(keyData); assertThat(result).isEqualTo(FilesystemKeyPair.class); }
public static Class<? extends ConfigKeyPair> getKeyPairTypeFor(KeyData keyData) { if (isDirect(keyData)) { return DirectKeyPair.class; } if (isInline(keyData)) { return InlineKeypair.class; } if (isAzure(keyData)) { return AzureVaultKeyPair.class; } if (isHashicorp(keyData)) { return HashicorpVaultKeyPair.class; } if (isAws(keyData)) { return AWSKeyPair.class; } if (isFileSystem(keyData)) { return FilesystemKeyPair.class; } return UnsupportedKeyPair.class; }
KeyDataUtil { public static Class<? extends ConfigKeyPair> getKeyPairTypeFor(KeyData keyData) { if (isDirect(keyData)) { return DirectKeyPair.class; } if (isInline(keyData)) { return InlineKeypair.class; } if (isAzure(keyData)) { return AzureVaultKeyPair.class; } if (isHashicorp(keyData)) { return HashicorpVaultKeyPair.class; } if (isAws(keyData)) { return AWSKeyPair.class; } if (isFileSystem(keyData)) { return FilesystemKeyPair.class; } return UnsupportedKeyPair.class; } }
KeyDataUtil { public static Class<? extends ConfigKeyPair> getKeyPairTypeFor(KeyData keyData) { if (isDirect(keyData)) { return DirectKeyPair.class; } if (isInline(keyData)) { return InlineKeypair.class; } if (isAzure(keyData)) { return AzureVaultKeyPair.class; } if (isHashicorp(keyData)) { return HashicorpVaultKeyPair.class; } if (isAws(keyData)) { return AWSKeyPair.class; } if (isFileSystem(keyData)) { return FilesystemKeyPair.class; } return UnsupportedKeyPair.class; } private  KeyDataUtil(); }
KeyDataUtil { public static Class<? extends ConfigKeyPair> getKeyPairTypeFor(KeyData keyData) { if (isDirect(keyData)) { return DirectKeyPair.class; } if (isInline(keyData)) { return InlineKeypair.class; } if (isAzure(keyData)) { return AzureVaultKeyPair.class; } if (isHashicorp(keyData)) { return HashicorpVaultKeyPair.class; } if (isAws(keyData)) { return AWSKeyPair.class; } if (isFileSystem(keyData)) { return FilesystemKeyPair.class; } return UnsupportedKeyPair.class; } private  KeyDataUtil(); static Class<? extends ConfigKeyPair> getKeyPairTypeFor(KeyData keyData); static boolean isLocked(KeyData keyData); static boolean isDirect(KeyData keyData); static boolean isInline(KeyData keyData); static boolean isAzure(KeyData keyData); static boolean isHashicorp(KeyData keyData); static boolean isAws(KeyData keyData); static boolean isFileSystem(KeyData keyData); static boolean isUnsupported(KeyData keyData); static ConfigKeyPair unmarshal(final KeyData keyData, final KeyEncryptor keyEncryptor); static KeyData marshal(final ConfigKeyPair keyPair); }
KeyDataUtil { public static Class<? extends ConfigKeyPair> getKeyPairTypeFor(KeyData keyData) { if (isDirect(keyData)) { return DirectKeyPair.class; } if (isInline(keyData)) { return InlineKeypair.class; } if (isAzure(keyData)) { return AzureVaultKeyPair.class; } if (isHashicorp(keyData)) { return HashicorpVaultKeyPair.class; } if (isAws(keyData)) { return AWSKeyPair.class; } if (isFileSystem(keyData)) { return FilesystemKeyPair.class; } return UnsupportedKeyPair.class; } private  KeyDataUtil(); static Class<? extends ConfigKeyPair> getKeyPairTypeFor(KeyData keyData); static boolean isLocked(KeyData keyData); static boolean isDirect(KeyData keyData); static boolean isInline(KeyData keyData); static boolean isAzure(KeyData keyData); static boolean isHashicorp(KeyData keyData); static boolean isAws(KeyData keyData); static boolean isFileSystem(KeyData keyData); static boolean isUnsupported(KeyData keyData); static ConfigKeyPair unmarshal(final KeyData keyData, final KeyEncryptor keyEncryptor); static KeyData marshal(final ConfigKeyPair keyPair);  }