@Test public void onlyPublicKeyVersionSetIsNotValid() { when(keyPair.getPublicKeyVersion()).thenReturn("pubVer"); when(keyPair.getPrivateKeyVersion()).thenReturn(null); assertThat(validator.isValid(keyPair, cvc)).isFalse(); }
@Override public boolean isValid(final AzureVaultKeyPair keypair, final ConstraintValidatorContext cvc) { if (keypair == null) { return true; } return Objects.isNull(keypair.getPublicKeyVersion()) == Objects.isNull(keypair.getPrivateKeyVersion()); }
AzureVaultKeyPairValidator implements ConstraintValidator<ValidAzureVaultKeyPair, AzureVaultKeyPair> { @Override public boolean isValid(final AzureVaultKeyPair keypair, final ConstraintValidatorContext cvc) { if (keypair == null) { return true; } return Objects.isNull(keypair.getPublicKeyVersion()) == Objects.isNull(keypair.getPrivateKeyVersion()); } }
AzureVaultKeyPairValidator implements ConstraintValidator<ValidAzureVaultKeyPair, AzureVaultKeyPair> { @Override public boolean isValid(final AzureVaultKeyPair keypair, final ConstraintValidatorContext cvc) { if (keypair == null) { return true; } return Objects.isNull(keypair.getPublicKeyVersion()) == Objects.isNull(keypair.getPrivateKeyVersion()); }  }
AzureVaultKeyPairValidator implements ConstraintValidator<ValidAzureVaultKeyPair, AzureVaultKeyPair> { @Override public boolean isValid(final AzureVaultKeyPair keypair, final ConstraintValidatorContext cvc) { if (keypair == null) { return true; } return Objects.isNull(keypair.getPublicKeyVersion()) == Objects.isNull(keypair.getPrivateKeyVersion()); }  @Override boolean isValid(final AzureVaultKeyPair keypair, final ConstraintValidatorContext cvc); }
AzureVaultKeyPairValidator implements ConstraintValidator<ValidAzureVaultKeyPair, AzureVaultKeyPair> { @Override public boolean isValid(final AzureVaultKeyPair keypair, final ConstraintValidatorContext cvc) { if (keypair == null) { return true; } return Objects.isNull(keypair.getPublicKeyVersion()) == Objects.isNull(keypair.getPrivateKeyVersion()); }  @Override boolean isValid(final AzureVaultKeyPair keypair, final ConstraintValidatorContext cvc);  }