@Test public void encrypt_invalid_emptyValue() { assertEquals(1, ValidateUtils.validateCipherParams(Mode.ENCRYPTION, KEY, "").size()); }
@NonNull static List<String> validateCipherParams(@NonNull Mode mode, @Nullable String key, @Nullable String value) { List<String> errors = new ArrayList<>(); if (mode != Mode.AUTHENTICATION) { if (StringUtils.isBlankOrNull(key)) { errors.add("Key is required if encryption or decryption is used!"); } if (StringUtils.isBlankOrNull(value)) { errors.add("Value is required if encryption or decryption is used!"); } } return errors; }
ValidateUtils { @NonNull static List<String> validateCipherParams(@NonNull Mode mode, @Nullable String key, @Nullable String value) { List<String> errors = new ArrayList<>(); if (mode != Mode.AUTHENTICATION) { if (StringUtils.isBlankOrNull(key)) { errors.add("Key is required if encryption or decryption is used!"); } if (StringUtils.isBlankOrNull(value)) { errors.add("Value is required if encryption or decryption is used!"); } } return errors; } }
ValidateUtils { @NonNull static List<String> validateCipherParams(@NonNull Mode mode, @Nullable String key, @Nullable String value) { List<String> errors = new ArrayList<>(); if (mode != Mode.AUTHENTICATION) { if (StringUtils.isBlankOrNull(key)) { errors.add("Key is required if encryption or decryption is used!"); } if (StringUtils.isBlankOrNull(value)) { errors.add("Value is required if encryption or decryption is used!"); } } return errors; } private  ValidateUtils(); }
ValidateUtils { @NonNull static List<String> validateCipherParams(@NonNull Mode mode, @Nullable String key, @Nullable String value) { List<String> errors = new ArrayList<>(); if (mode != Mode.AUTHENTICATION) { if (StringUtils.isBlankOrNull(key)) { errors.add("Key is required if encryption or decryption is used!"); } if (StringUtils.isBlankOrNull(value)) { errors.add("Value is required if encryption or decryption is used!"); } } return errors; } private  ValidateUtils();  }
ValidateUtils { @NonNull static List<String> validateCipherParams(@NonNull Mode mode, @Nullable String key, @Nullable String value) { List<String> errors = new ArrayList<>(); if (mode != Mode.AUTHENTICATION) { if (StringUtils.isBlankOrNull(key)) { errors.add("Key is required if encryption or decryption is used!"); } if (StringUtils.isBlankOrNull(value)) { errors.add("Value is required if encryption or decryption is used!"); } } return errors; } private  ValidateUtils();   }