fun testVcsRootParametrizedInSubprojectShouldNotBeShownInParentProject()

in src/test-integration/kotlin/org/jetbrains/teamcity/github/GitHubWebHookSuggestionTest.kt [71:98]


    fun testVcsRootParametrizedInSubprojectShouldNotBeShownInParentProject() {
        val p1 = myFixture.createProject("P1")
        val p2 = myFixture.createProject("P2", p1)

        val bt2 = registerBuildType("BT2", p2, "Ant")

        val vcs = addGitVcsRoot(p1, "https://github.com/%owner%/%name%")

        bt2.addVcsRoot(vcs)
        bt2.addParameter(SimpleParameter("owner", "A"))
        bt2.addParameter(SimpleParameter("name", "B"))

        addGitHubConnection(p2)


        val consumer = report(p1.buildTypes)

        then(consumer.project.keys).containsOnly(p2)
        then(consumer.project[p2]).hasSize(1)

        then(consumer.vcsRoot).isEmpty() // Vcs Root belongs to parent project which does not have connection

        then(consumer.buildType.keys).containsOnly(bt2)
        then(consumer.buildType[bt2]).hasSize(1)

        then(consumer.all).hasSize(1)
        then(consumer.all.first().additionalData["Project"]).isEqualTo(p2)
    }