Correct inheriting superproject subscription test

First we need to setup the ACL inheritance for the project being subscribed
to and not the superproject. And we also need to change the branches that
are setup to be correct. And once that is done, the expectation of
success changes as well.

I think this mistake was introduced by too much copy&paste from the test
directly above (testSubscriptionFailOnWrongBranchACL)

Change-Id: Ibcaaa33bec9149dcd4c77660eba710f9b5a177b9
Signed-off-by: Stefan Beller <sbeller@google.com>
This commit is contained in:
Stefan Beller
2016-05-24 10:18:22 -07:00
parent 85b276b3be
commit 7b0676285d

View File

@@ -339,18 +339,20 @@ public class SubmoduleSubscriptionsIT extends AbstractSubmoduleSubscription {
@Test @Test
public void testSubscriptionInheritACL() throws Exception { public void testSubscriptionInheritACL() throws Exception {
createProjectWithPush("config-repo"); createProjectWithPush("config-repo");
TestRepository<?> superRepo = createProjectWithPush("super-project", createProjectWithPush("config-repo2",
new Project.NameKey(name("config-repo"))); new Project.NameKey(name("config-repo")));
TestRepository<?> subRepo = createProjectWithPush("subscribed-to-project"); TestRepository<?> superRepo = createProjectWithPush("super-project");
allowSubmoduleSubscription("config-repo", "refs/heads/master", TestRepository<?> subRepo = createProjectWithPush("subscribed-to-project",
"super-project", "refs/heads/wrong-branch"); new Project.NameKey(name("config-repo2")));
allowSubmoduleSubscription("config-repo", "refs/heads/*",
"super-project", "refs/heads/*");
pushChangeTo(subRepo, "master"); pushChangeTo(subRepo, "master");
createSubmoduleSubscription(superRepo, "master", createSubmoduleSubscription(superRepo, "master",
"subscribed-to-project", "master"); "subscribed-to-project", "master");
pushChangeTo(subRepo, "master"); ObjectId subHEAD = pushChangeTo(subRepo, "master");
assertThat(hasSubmodule(superRepo, "master", expectToHaveSubmoduleState(superRepo, "master",
"subscribed-to-project")).isFalse(); "subscribed-to-project", subHEAD);
} }
@Test @Test