Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ac
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OATS-CADC
ac
Commits
e5791a3e
Commit
e5791a3e
authored
9 years ago
by
Brian Major
Browse files
Options
Downloads
Plain Diff
Merge branch 'ac2' of
ssh://gimli2.cadc.dao.nrc.ca/srv/cadc/git/wopencadc
into ac2
parents
acf82791
9fcb2c8e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
projects/cadcAccessControl/test/src/ca/nrc/cadc/ac/client/UserClientTest.java
+22
-7
22 additions, 7 deletions
...ontrol/test/src/ca/nrc/cadc/ac/client/UserClientTest.java
with
22 additions
and
7 deletions
projects/cadcAccessControl/test/src/ca/nrc/cadc/ac/client/UserClientTest.java
+
22
−
7
View file @
e5791a3e
...
...
@@ -138,16 +138,23 @@ public class UserClientTest
}
@Test
public
void
testSubjectWithNoPrincipal
()
throws
URISyntaxException
,
MalformedURLException
public
void
testSubjectWithNoPrincipal
()
{
// test subject augmentation given a subject with no principal
Subject
subject
=
new
Subject
();
this
.
createUserClient
().
augmentSubject
(
subject
);
Assert
.
assertEquals
(
"Should have no principal."
,
0
,
subject
.
getPrincipals
().
size
());
try
{
// test subject augmentation given a subject with no principal
Subject
subject
=
new
Subject
();
this
.
createUserClient
().
augmentSubject
(
subject
);
Assert
.
assertEquals
(
"Should have no principal."
,
0
,
subject
.
getPrincipals
().
size
());
}
catch
(
Throwable
t
)
{
Assert
.
fail
(
"Unexpected exception: "
+
t
.
getMessage
());
}
}
@Test
public
void
testSubjectWithMultiplePrincipal
()
throws
URISyntaxException
,
MalformedURLException
public
void
testSubjectWithMultiplePrincipal
()
{
try
{
...
...
@@ -163,10 +170,14 @@ public class UserClientTest
String
expected
=
"Subject has more than one principal."
;
Assert
.
assertEquals
(
expected
,
e
.
getMessage
());
}
catch
(
Throwable
t
)
{
Assert
.
fail
(
"Unexpected exception: "
+
t
.
getMessage
());
}
}
@Test
public
void
testSubjectWithUnsupportedPrincipal
()
throws
URISyntaxException
,
MalformedURLException
public
void
testSubjectWithUnsupportedPrincipal
()
{
Principal
principal
=
new
JMXPrincipal
(
"APIName"
);
try
...
...
@@ -182,6 +193,10 @@ public class UserClientTest
String
expected
=
"Subject has unsupported principal "
+
principal
.
getName
();
Assert
.
assertEquals
(
expected
,
e
.
getMessage
());
}
catch
(
Throwable
t
)
{
Assert
.
fail
(
"Unexpected exception: "
+
t
.
getMessage
());
}
}
protected
UserClient
createUserClient
()
throws
URISyntaxException
,
MalformedURLException
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment