Skip to content
Snippets Groups Projects
Commit cf9becf1 authored by bmajor's avatar bmajor Committed by GitHub
Browse files

Merge pull request #22 from pdowler/master

fix GroupURI to check that scheme is ivo
parents e29bf705 e3d981bc
No related branches found
No related tags found
No related merge requests found
...@@ -15,7 +15,7 @@ sourceCompatibility = 1.7 ...@@ -15,7 +15,7 @@ sourceCompatibility = 1.7
group = 'org.opencadc' group = 'org.opencadc'
version = '1.1.3' version = '1.1.4'
mainClassName = 'ca.nrc.cadc.ac.client.Main' mainClassName = 'ca.nrc.cadc.ac.client.Main'
......
...@@ -99,9 +99,9 @@ public class GroupURI ...@@ -99,9 +99,9 @@ public class GroupURI
} }
// Ensure the scheme is correct // Ensure the scheme is correct
if (uri.getScheme() == null) if (uri.getScheme() == null || !"ivo".equals(uri.getScheme()))
{ {
throw new IllegalArgumentException("GroupURI scheme is required."); throw new IllegalArgumentException("GroupURI scheme must be 'ivo'.");
} }
if (uri.getAuthority() == null) if (uri.getAuthority() == null)
......
...@@ -38,6 +38,9 @@ public class GroupURITest ...@@ -38,6 +38,9 @@ public class GroupURITest
// no scheme // no scheme
assertIllegalArgument("example.org/gms?gname", "scheme"); assertIllegalArgument("example.org/gms?gname", "scheme");
// wrong scheme
assertIllegalArgument("gms://example.org/gms?gname", "scheme");
// no authority // no authority
assertIllegalArgument("ivo://gms?gname", "authority"); assertIllegalArgument("ivo://gms?gname", "authority");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment