All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.nemerosa.ontrack.acceptance.ACCDSLProject.groovy Maven / Gradle / Ivy

The newest version!
package net.nemerosa.ontrack.acceptance

import net.nemerosa.ontrack.acceptance.support.AcceptanceTestSuite
import net.nemerosa.ontrack.dsl.properties.MainBuildLinks
import org.junit.Test

import static net.nemerosa.ontrack.test.TestUtils.uid

/**
 * Acceptance tests for the project DSL
 */
@AcceptanceTestSuite
class ACCDSLProject extends AbstractACCDSL {

    @Test
    void 'No main build links property'() {
        def projectName = uid('P')
        def project = ontrack.project(projectName)

        // Gets the main build links property
        def mainBuildLinks = project.config.mainBuildLinks
        assert mainBuildLinks == null: "No main build links property is defined."
    }

    @Test
    void 'Main build links property'() {
        def projectName = uid('P')
        def project = ontrack.project(projectName)

        // Sets the main build links property
        project.config.mainBuildLinks = new MainBuildLinks(
                ["my-dependency"],
                true
        )

        // Gets the main build links property
        def mainBuildLinks = project.config.mainBuildLinks
        assert mainBuildLinks.labels == ["my-dependency"]
        assert mainBuildLinks.overrideGlobal: "Override global flag is set to true"
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy