[java-support] branch main updated: GEN-264 - Adapt to changing HEAD branch on repositories
Ian Young
ian at iay.org.uk
Sun Aug 16 09:11:44 UTC 2020
This is an automated email from the git hooks/post-receive script.
iay pushed a commit to branch main
in repository java-support.
View the commit online:
http://git.shibboleth.net/view/?p=java-support.git;a=commit;h=25f256f1a581d7cf191ad2d3f40d1fde50de664e
The following commit(s) were added to refs/heads/main by this push:
new 25f256f GEN-264 - Adapt to changing HEAD branch on repositories
25f256f is described below
commit 25f256f1a581d7cf191ad2d3f40d1fde50de664e
Author: Ian Young <ian at iay.org.uk>
AuthorDate: Sun Aug 16 10:11:39 2020 +0100
GEN-264 - Adapt to changing HEAD branch on repositories
https://issues.shibboleth.net/jira/browse/GEN-264
---
.../java/support/repository/RepositorySupport.java | 4 +--
.../support/repository/RepositorySupportTest.java | 32 ++++++++++++++++++++++
2 files changed, 34 insertions(+), 2 deletions(-)
diff --git a/src/test/java/net/shibboleth/utilities/java/support/repository/RepositorySupport.java b/src/test/java/net/shibboleth/utilities/java/support/repository/RepositorySupport.java
index 5accf35..5db2a33 100644
--- a/src/test/java/net/shibboleth/utilities/java/support/repository/RepositorySupport.java
+++ b/src/test/java/net/shibboleth/utilities/java/support/repository/RepositorySupport.java
@@ -62,9 +62,9 @@ public final class RepositorySupport {
}
if (https) {
- return String.format("https://test.shibboleth.net/git/view/?p=%s.git&a=blob_plain&f=%s&hb=master", repo, path);
+ return String.format("https://test.shibboleth.net/git/view/?p=%s.git&a=blob_plain&f=%s&hb=HEAD", repo, path);
}
- return String.format("http://git.shibboleth.net/view/?p=%s.git&a=blob_plain&f=%s&hb=master", repo, path);
+ return String.format("http://git.shibboleth.net/view/?p=%s.git&a=blob_plain&f=%s&hb=HEAD", repo, path);
}
diff --git a/src/test/java/net/shibboleth/utilities/java/support/repository/RepositorySupportTest.java b/src/test/java/net/shibboleth/utilities/java/support/repository/RepositorySupportTest.java
new file mode 100644
index 0000000..c20c24d
--- /dev/null
+++ b/src/test/java/net/shibboleth/utilities/java/support/repository/RepositorySupportTest.java
@@ -0,0 +1,32 @@
+
+package net.shibboleth.utilities.java.support.repository;
+
+import java.io.IOException;
+import java.net.URL;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+
+public class RepositorySupportTest {
+
+ @Test
+ public void testBuildHTTPResourceURLTest() throws IOException {
+ final String s = RepositorySupport.buildHTTPResourceURL("java-support",
+ "src/test/java/net/shibboleth/utilities/java/support/repository/RepositorySupport.java", false);
+ final URL u = new URL(s);
+ Assert.assertNotNull(u);
+ Assert.assertNotNull(u.getContent());
+ }
+
+ @Test
+ public void testBuildHTTPSResourceURLTest() throws IOException {
+ final String s = RepositorySupport.buildHTTPSResourceURL("java-support",
+ "src/test/java/net/shibboleth/utilities/java/support/repository/RepositorySupport.java");
+ final URL u = new URL(s);
+ Assert.assertNotNull(u);
+ // Can't dereference, as test.shibboleth.net has a non-commercial certificate
+ // Real uses need to take this into account.
+ // Assert.assertNotNull(u.getContent());
+ }
+}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list