Search in sources :

Example 1 with ArtifactoryExtensionFeature

use of net.nemerosa.ontrack.extension.artifactory.ArtifactoryExtensionFeature in project ontrack by nemerosa.

the class ArtifactoryPromotionSyncServiceImplTest method syncBuildJobs_one_per_configured_branch.

@Test
public void syncBuildJobs_one_per_configured_branch() {
    when(propertyService.hasProperty(branch, ArtifactoryPromotionSyncPropertyType.class)).thenReturn(true);
    Property<ArtifactoryPromotionSyncProperty> property = Property.of(new ArtifactoryPromotionSyncPropertyType(new ArtifactoryExtensionFeature(), null), new ArtifactoryPromotionSyncProperty(null, "", "", 10));
    when(propertyService.getProperty(branch, ArtifactoryPromotionSyncPropertyType.class)).thenReturn(property);
    when(structureService.getProjectList()).thenReturn(Collections.singletonList(project));
    when(structureService.getBranchesForProject(project.getId())).thenReturn(Collections.singletonList(branch));
    // Gets the list of jobs
    assertEquals(1, service.collectJobRegistrations().count());
}
Also used : ArtifactoryPromotionSyncPropertyType(net.nemerosa.ontrack.extension.artifactory.property.ArtifactoryPromotionSyncPropertyType) ArtifactoryExtensionFeature(net.nemerosa.ontrack.extension.artifactory.ArtifactoryExtensionFeature) ArtifactoryPromotionSyncProperty(net.nemerosa.ontrack.extension.artifactory.property.ArtifactoryPromotionSyncProperty) Test(org.junit.Test)

Aggregations

ArtifactoryExtensionFeature (net.nemerosa.ontrack.extension.artifactory.ArtifactoryExtensionFeature)1 ArtifactoryPromotionSyncProperty (net.nemerosa.ontrack.extension.artifactory.property.ArtifactoryPromotionSyncProperty)1 ArtifactoryPromotionSyncPropertyType (net.nemerosa.ontrack.extension.artifactory.property.ArtifactoryPromotionSyncPropertyType)1 Test (org.junit.Test)1