use of com.synopsys.integration.alert.channel.azure.boards.oauth.OAuthRequestValidator in project blackduck-alert by blackducksoftware.
the class AzureBoardsGlobalConfigurationFieldModelValidatorTest method oauthRequestIsRunningError.
@Test
public void oauthRequestIsRunningError() {
OAuthRequestValidator oAuthRequestValidator = new OAuthRequestValidator();
oAuthRequestValidator.addAuthorizationRequest("test");
AzureBoardsGlobalConfigurationFieldModelValidator azureBoardsGlobalConfigurationValidator = new AzureBoardsGlobalConfigurationFieldModelValidator(oAuthRequestValidator);
Set<AlertFieldStatus> fieldStatuses = azureBoardsGlobalConfigurationValidator.validate(new FieldModel(new AzureBoardsChannelKey().getUniversalKey(), ConfigContextEnum.GLOBAL.name(), createValidKeyToValues()));
assertEquals(1, fieldStatuses.size());
AlertFieldStatus alertFieldStatus = fieldStatuses.stream().findFirst().orElse(null);
assertNotNull(alertFieldStatus);
assertEquals(AzureBoardsDescriptor.KEY_OAUTH, alertFieldStatus.getFieldName());
}
use of com.synopsys.integration.alert.channel.azure.boards.oauth.OAuthRequestValidator in project hub-alert by blackducksoftware.
the class AzureBoardsGlobalConfigurationFieldModelValidatorTest method oauthRequestIsRunningError.
@Test
public void oauthRequestIsRunningError() {
OAuthRequestValidator oAuthRequestValidator = new OAuthRequestValidator();
oAuthRequestValidator.addAuthorizationRequest("test");
AzureBoardsGlobalConfigurationFieldModelValidator azureBoardsGlobalConfigurationValidator = new AzureBoardsGlobalConfigurationFieldModelValidator(oAuthRequestValidator);
Set<AlertFieldStatus> fieldStatuses = azureBoardsGlobalConfigurationValidator.validate(new FieldModel(new AzureBoardsChannelKey().getUniversalKey(), ConfigContextEnum.GLOBAL.name(), createValidKeyToValues()));
assertEquals(1, fieldStatuses.size());
AlertFieldStatus alertFieldStatus = fieldStatuses.stream().findFirst().orElse(null);
assertNotNull(alertFieldStatus);
assertEquals(AzureBoardsDescriptor.KEY_OAUTH, alertFieldStatus.getFieldName());
}
Aggregations