use of com.synopsys.integration.alert.common.rest.model.SettingsProxyModel in project hub-alert by blackducksoftware.
the class SettingsProxyValidatorTest method validatePasswordWithoutUsernameTest.
@Test
void validatePasswordWithoutUsernameTest() {
SettingsProxyModel settingsProxyModel = new SettingsProxyModel();
settingsProxyModel.setName(AlertRestConstants.DEFAULT_CONFIGURATION_NAME);
settingsProxyModel.setProxyHost(HOST);
settingsProxyModel.setProxyPort(PORT);
settingsProxyModel.setProxyPassword(PASSWORD);
ValidationResponseModel validationResponseModel = settingsProxyValidator.validate(settingsProxyModel);
assertTrue(validationResponseModel.hasErrors());
assertEquals(1, validationResponseModel.getErrors().size());
assertTrue(validationResponseModel.getErrors().containsKey(SettingsProxyValidator.PROXY_USERNAME_FIELD_NAME));
}
use of com.synopsys.integration.alert.common.rest.model.SettingsProxyModel in project hub-alert by blackducksoftware.
the class SettingsProxyValidatorTest method validateNameMissingTest.
@Test
void validateNameMissingTest() {
SettingsProxyModel settingsProxyModel = new SettingsProxyModel();
settingsProxyModel.setProxyHost(HOST);
settingsProxyModel.setProxyPort(PORT);
settingsProxyModel.setProxyUsername(USERNAME);
settingsProxyModel.setProxyPassword(PASSWORD);
ValidationResponseModel validationResponseModel = settingsProxyValidator.validate(settingsProxyModel);
assertTrue(validationResponseModel.hasErrors());
assertEquals(1, validationResponseModel.getErrors().size());
assertTrue(validationResponseModel.getErrors().containsKey(SettingsProxyValidator.PROXY_CONFIGURATION_NAME));
}
use of com.synopsys.integration.alert.common.rest.model.SettingsProxyModel in project hub-alert by blackducksoftware.
the class SettingsProxyValidatorTest method validateTest.
@Test
void validateTest() {
SettingsProxyModel settingsProxyModel = new SettingsProxyModel();
settingsProxyModel.setName(AlertRestConstants.DEFAULT_CONFIGURATION_NAME);
settingsProxyModel.setProxyHost(HOST);
settingsProxyModel.setProxyPort(PORT);
settingsProxyModel.setProxyUsername(USERNAME);
settingsProxyModel.setProxyPassword(PASSWORD);
ValidationResponseModel validationResponseModel = settingsProxyValidator.validate(settingsProxyModel);
assertFalse(validationResponseModel.hasErrors());
}
use of com.synopsys.integration.alert.common.rest.model.SettingsProxyModel in project hub-alert by blackducksoftware.
the class SettingsProxyValidatorTest method validateUsernameWithoutPasswordIsProxyPasswordSetTest.
@Test
void validateUsernameWithoutPasswordIsProxyPasswordSetTest() {
SettingsProxyModel settingsProxyModel = new SettingsProxyModel();
settingsProxyModel.setName(AlertRestConstants.DEFAULT_CONFIGURATION_NAME);
settingsProxyModel.setProxyHost(HOST);
settingsProxyModel.setProxyPort(PORT);
settingsProxyModel.setProxyUsername(USERNAME);
settingsProxyModel.setIsProxyPasswordSet(true);
ValidationResponseModel validationResponseModel = settingsProxyValidator.validate(settingsProxyModel);
assertFalse(validationResponseModel.hasErrors());
}
use of com.synopsys.integration.alert.common.rest.model.SettingsProxyModel in project hub-alert by blackducksoftware.
the class SettingsProxyValidatorTest method validateIsPasswordSetWithoutUsernameTest.
@Test
void validateIsPasswordSetWithoutUsernameTest() {
SettingsProxyModel settingsProxyModel = new SettingsProxyModel();
settingsProxyModel.setName(AlertRestConstants.DEFAULT_CONFIGURATION_NAME);
settingsProxyModel.setProxyHost(HOST);
settingsProxyModel.setProxyPort(PORT);
settingsProxyModel.setIsProxyPasswordSet(true);
ValidationResponseModel validationResponseModel = settingsProxyValidator.validate(settingsProxyModel);
assertTrue(validationResponseModel.hasErrors());
assertEquals(1, validationResponseModel.getErrors().size());
assertTrue(validationResponseModel.getErrors().containsKey(SettingsProxyValidator.PROXY_USERNAME_FIELD_NAME));
}
Aggregations