net.nemerosa.ontrack.acceptance.ACCDSLProject.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ontrack-acceptance Show documentation
Show all versions of ontrack-acceptance Show documentation
Ontrack module: ontrack-acceptance
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"
}
}