diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2019-11-25 09:31:49 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@gmail.com> | 2019-11-25 09:31:49 +0900 |
commit | f2ccc421323baad8e0e3a7b8bd52048e65cfb944 (patch) | |
tree | bbe5ed9748828a953fe94b2bba0e6035bcd3cde9 | |
parent | f5f5c80bf582992a1d1f8f82a6bba4b93e491eb5 (diff) | |
download | jgit-f2ccc421323baad8e0e3a7b8bd52048e65cfb944.tar.gz jgit-f2ccc421323baad8e0e3a7b8bd52048e65cfb944.zip |
UploadPackTest: Fix unused parameter in checkUnadvertisedIfUnallowed
Change-Id: I6042c401fff55325128d47e7e9098fc7e60d501d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java index 6d53555e9f..108e5edb78 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java @@ -462,7 +462,9 @@ public class UploadPackTest { assertThat(lines, containsInAnyOrder("ls-refs", "fetch", "server-option")); } - private void checkUnadvertisedIfUnallowed(String fetchCapability) throws Exception { + private void checkUnadvertisedIfUnallowed(String configSection, + String configName, String fetchCapability) throws Exception { + server.getConfig().setBoolean(configSection, null, configName, false); ByteArrayInputStream recvStream = uploadPackV2Setup(null, PacketLineIn.end()); PacketLineIn pckIn = new PacketLineIn(recvStream); @@ -473,9 +475,9 @@ public class UploadPackTest { String line; while (!PacketLineIn.isEnd((line = pckIn.readString()))) { if (line.startsWith("fetch=")) { - assertThat( - Arrays.asList(line.substring(6).split(" ")), - hasItems("shallow")); + List<String> fetchItems = Arrays.asList(line.substring(6).split(" ")); + assertThat(fetchItems, hasItems("shallow")); + assertFalse(fetchItems.contains(fetchCapability)); lines.add("fetch"); } else { lines.add(line); @@ -487,7 +489,7 @@ public class UploadPackTest { @Test public void testV2CapabilitiesAllowFilter() throws Exception { checkAdvertisedIfAllowed("uploadpack", "allowfilter", "filter"); - checkUnadvertisedIfUnallowed("filter"); + checkUnadvertisedIfUnallowed("uploadpack", "allowfilter", "filter"); } @Test @@ -497,7 +499,8 @@ public class UploadPackTest { @Test public void testV2CapabilitiesRefInWantNotAdvertisedIfUnallowed() throws Exception { - checkUnadvertisedIfUnallowed("ref-in-want"); + checkUnadvertisedIfUnallowed("uploadpack", "allowrefinwant", + "ref-in-want"); } @Test @@ -506,7 +509,8 @@ public class UploadPackTest { true); checkAdvertisedIfAllowed("uploadpack", "advertisesidebandall", "sideband-all"); - checkUnadvertisedIfUnallowed("sideband-all"); + checkUnadvertisedIfUnallowed("uploadpack", "advertisesidebandall", + "sideband-all"); } @Test |