use of com.synopsys.integration.alert.component.settings.encryption.model.SettingsEncryptionModel in project hub-alert by blackducksoftware.
the class SettingsEncryptionValidatorTest method validateNotInitializedNoPasswordTest.
@Test
public void validateNotInitializedNoPasswordTest() {
MockAlertProperties alertPropertiesNoEncryption = new MockAlertProperties();
alertPropertiesNoEncryption.setEncryptionPassword("");
alertPropertiesNoEncryption.setEncryptionSalt("");
FilePersistenceUtil filePersistenceUtilWithoutProperties = new FilePersistenceUtil(alertPropertiesNoEncryption, gson);
EncryptionUtility encryptionUtilityWithoutProperties = new EncryptionUtility(alertPropertiesNoEncryption, filePersistenceUtilWithoutProperties);
SettingsEncryptionModel settingsEncryptionModel = new SettingsEncryptionModel();
settingsEncryptionModel.setEncryptionGlobalSalt("globalSalt");
SettingsEncryptionValidator validator = new SettingsEncryptionValidator(encryptionUtilityWithoutProperties, systemMessageAccessor);
ValidationResponseModel validationResponseModel = validator.validate(settingsEncryptionModel);
assertTrue(validationResponseModel.hasErrors());
assertEquals(1, validationResponseModel.getErrors().size());
}
use of com.synopsys.integration.alert.component.settings.encryption.model.SettingsEncryptionModel in project hub-alert by blackducksoftware.
the class SettingsEncryptionValidatorTest method validateNotInitializedNoGlobalSaltTest.
@Test
public void validateNotInitializedNoGlobalSaltTest() {
MockAlertProperties alertPropertiesNoEncryption = new MockAlertProperties();
alertPropertiesNoEncryption.setEncryptionPassword("");
alertPropertiesNoEncryption.setEncryptionSalt("");
FilePersistenceUtil filePersistenceUtilWithoutProperties = new FilePersistenceUtil(alertPropertiesNoEncryption, gson);
EncryptionUtility encryptionUtilityWithoutProperties = new EncryptionUtility(alertPropertiesNoEncryption, filePersistenceUtilWithoutProperties);
SettingsEncryptionModel settingsEncryptionModel = new SettingsEncryptionModel();
settingsEncryptionModel.setEncryptionPassword("password");
SettingsEncryptionValidator validator = new SettingsEncryptionValidator(encryptionUtilityWithoutProperties, systemMessageAccessor);
ValidationResponseModel validationResponseModel = validator.validate(settingsEncryptionModel);
assertTrue(validationResponseModel.hasErrors());
assertEquals(1, validationResponseModel.getErrors().size());
}
Aggregations