Search in sources :

Example 1 with AzureBoardsChannelKey

use of com.synopsys.integration.alert.descriptor.api.AzureBoardsChannelKey in project hub-alert by blackducksoftware.

the class StaticJobAccessorTestIT method verifyAzureSavesTest.

@Test
@Transactional
public void verifyAzureSavesTest() {
    AzureBoardsJobDetailsModel azureBoardsJobDetailsModel = new AzureBoardsJobDetailsModel(UUID.randomUUID(), true, "projectNameOrId", "workItemType", "workItemCompletedState", "workItemReopenState");
    DistributionJobRequestModel jobRequestModel = createJobRequestModel(azureBoardsJobDetailsModel, new AzureBoardsChannelKey());
    createAndAssertJob(jobRequestModel);
}
Also used : AzureBoardsChannelKey(com.synopsys.integration.alert.descriptor.api.AzureBoardsChannelKey) AzureBoardsJobDetailsModel(com.synopsys.integration.alert.common.persistence.model.job.details.AzureBoardsJobDetailsModel) DistributionJobRequestModel(com.synopsys.integration.alert.common.persistence.model.job.DistributionJobRequestModel) AlertIntegrationTest(com.synopsys.integration.alert.util.AlertIntegrationTest) Test(org.junit.jupiter.api.Test) Transactional(org.springframework.transaction.annotation.Transactional)

Example 2 with AzureBoardsChannelKey

use of com.synopsys.integration.alert.descriptor.api.AzureBoardsChannelKey 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());
}
Also used : OAuthRequestValidator(com.synopsys.integration.alert.channel.azure.boards.oauth.OAuthRequestValidator) AzureBoardsChannelKey(com.synopsys.integration.alert.descriptor.api.AzureBoardsChannelKey) AlertFieldStatus(com.synopsys.integration.alert.common.descriptor.config.field.errors.AlertFieldStatus) FieldModel(com.synopsys.integration.alert.common.rest.model.FieldModel) Test(org.junit.jupiter.api.Test)

Aggregations

AzureBoardsChannelKey (com.synopsys.integration.alert.descriptor.api.AzureBoardsChannelKey)2 Test (org.junit.jupiter.api.Test)2 OAuthRequestValidator (com.synopsys.integration.alert.channel.azure.boards.oauth.OAuthRequestValidator)1 AlertFieldStatus (com.synopsys.integration.alert.common.descriptor.config.field.errors.AlertFieldStatus)1 DistributionJobRequestModel (com.synopsys.integration.alert.common.persistence.model.job.DistributionJobRequestModel)1 AzureBoardsJobDetailsModel (com.synopsys.integration.alert.common.persistence.model.job.details.AzureBoardsJobDetailsModel)1 FieldModel (com.synopsys.integration.alert.common.rest.model.FieldModel)1 AlertIntegrationTest (com.synopsys.integration.alert.util.AlertIntegrationTest)1 Transactional (org.springframework.transaction.annotation.Transactional)1