use of com.synopsys.integration.alert.api.common.model.ValidationResponseModel in project blackduck-alert by blackducksoftware.
the class SettingsProxyValidatorTest method validateNameMissingTest.
@Test
void validateNameMissingTest() {
SettingsProxyModel settingsProxyModel = new SettingsProxyModel(ID, null, CREATED_AT, LAST_UPDATED, HOST, PORT, USERNAME, PASSWORD, Boolean.TRUE, NON_PROXY_HOSTS);
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.api.common.model.ValidationResponseModel in project blackduck-alert by blackducksoftware.
the class SettingsProxyValidatorTest method validateUsernameBlank.
@Test
void validateUsernameBlank() {
SettingsProxyModel settingsProxyModel = new SettingsProxyModel(ID, AlertRestConstants.DEFAULT_CONFIGURATION_NAME, CREATED_AT, LAST_UPDATED, HOST, PORT, "", PASSWORD, Boolean.TRUE, NON_PROXY_HOSTS);
ValidationResponseModel validationResponseModel = settingsProxyValidator.validate(settingsProxyModel);
assertFalse(validationResponseModel.hasErrors());
}
use of com.synopsys.integration.alert.api.common.model.ValidationResponseModel in project blackduck-alert by blackducksoftware.
the class SettingsProxyValidatorTest method validateIsPasswordSetWithoutUsernameTest.
@Test
void validateIsPasswordSetWithoutUsernameTest() {
SettingsProxyModel settingsProxyModel = new SettingsProxyModel(ID, AlertRestConstants.DEFAULT_CONFIGURATION_NAME, CREATED_AT, LAST_UPDATED, HOST, PORT, null, null, Boolean.TRUE, NON_PROXY_HOSTS);
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.api.common.model.ValidationResponseModel in project blackduck-alert by blackducksoftware.
the class SettingsProxyValidatorTest method validatePortWithoutHostTest.
@Test
void validatePortWithoutHostTest() {
SettingsProxyModel settingsProxyModel = new SettingsProxyModel(ID, AlertRestConstants.DEFAULT_CONFIGURATION_NAME, CREATED_AT, LAST_UPDATED, null, PORT, USERNAME, PASSWORD, Boolean.TRUE, NON_PROXY_HOSTS);
ValidationResponseModel validationResponseModel = settingsProxyValidator.validate(settingsProxyModel);
assertTrue(validationResponseModel.hasErrors());
assertEquals(1, validationResponseModel.getErrors().size());
assertTrue(validationResponseModel.getErrors().containsKey(SettingsProxyValidator.PROXY_HOST_FIELD_NAME));
}
use of com.synopsys.integration.alert.api.common.model.ValidationResponseModel in project blackduck-alert by blackducksoftware.
the class SettingsProxyValidatorTest method validateUsernameWithoutPasswordTest.
@Test
void validateUsernameWithoutPasswordTest() {
SettingsProxyModel settingsProxyModel = new SettingsProxyModel(ID, AlertRestConstants.DEFAULT_CONFIGURATION_NAME, CREATED_AT, LAST_UPDATED, HOST, PORT, USERNAME, null, Boolean.FALSE, NON_PROXY_HOSTS);
ValidationResponseModel validationResponseModel = settingsProxyValidator.validate(settingsProxyModel);
assertTrue(validationResponseModel.hasErrors());
assertEquals(1, validationResponseModel.getErrors().size());
assertTrue(validationResponseModel.getErrors().containsKey(SettingsProxyValidator.PROXY_PASSWORD_FIELD_NAME));
}
Aggregations