Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Access Token Provider
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Gazelle
Applications
Test execution
Simulator
Access Token Provider
Commits
3438e716
Commit
3438e716
authored
4 years ago
by
Youn Cadoret
Browse files
Options
Downloads
Patches
Plain Diff
IUAINFRA-47 Add test for AudienceSecretRetrieverForSoapui
parent
53066392
No related branches found
No related tags found
1 merge request
!3
Feature/iuainfra 31
Pipeline
#165925
failed
4 years ago
Stage: build
Stage: tests
Stage: cleanup
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
access-token-provider-api/src/test/java/net/ihe/gazelle/app/accesstokenproviderapi/application/TokenGeneratorTest.java
+37
-0
37 additions, 0 deletions
...ccesstokenproviderapi/application/TokenGeneratorTest.java
with
37 additions
and
0 deletions
access-token-provider-api/src/test/java/net/ihe/gazelle/app/accesstokenproviderapi/application/TokenGeneratorTest.java
+
37
−
0
View file @
3438e716
...
...
@@ -175,4 +175,41 @@ class TokenGeneratorTest {
}
@Test
public
void
generateAccessTokenEmptyAudienceTest
()
throws
EncodingException
,
TokenRequestException
{
AccessTokenRequest
accessTokenRequest
=
new
AccessTokenRequest
(
ISSUER
,
SUBJECT
,
""
,
DURATION
,
TOKEN_TYPE
);
accessTokenRequest
.
setSignature
(
new
SymmetricSignature
(
ALGORITHM
,
"secret"
));
TokenGenerator
tokenGenerator
=
new
TokenGenerator
();
tokenGenerator
.
setAudienceSecretRetriever
(
AUDIENCE_RETRIEVER
);
assertThrows
(
TokenRequestException
.
class
,
()
->
tokenGenerator
.
generateAccessToken
(
accessTokenRequest
),
"Unsupported issuer"
);
}
@Test
public
void
generateAccessTokenEmptySecretTest
()
throws
EncodingException
,
TokenRequestException
{
AccessTokenRequest
accessTokenRequest
=
new
AccessTokenRequest
(
ISSUER
,
SUBJECT
,
"pouet"
,
DURATION
,
TOKEN_TYPE
);
accessTokenRequest
.
setSignature
(
new
SymmetricSignature
(
ALGORITHM
,
"secret"
));
TokenGenerator
tokenGenerator
=
new
TokenGenerator
();
tokenGenerator
.
setAudienceSecretRetriever
(
audience
->
""
);
assertThrows
(
TokenRequestException
.
class
,
()
->
tokenGenerator
.
generateAccessToken
(
accessTokenRequest
),
"Unsupported issuer"
);
}
@Test
public
void
generateAccessTokenNullSecretTest
()
throws
EncodingException
,
TokenRequestException
{
AccessTokenRequest
accessTokenRequest
=
new
AccessTokenRequest
(
ISSUER
,
SUBJECT
,
"pouet"
,
DURATION
,
TOKEN_TYPE
);
accessTokenRequest
.
setSignature
(
new
SymmetricSignature
(
ALGORITHM
,
"secret"
));
TokenGenerator
tokenGenerator
=
new
TokenGenerator
();
tokenGenerator
.
setAudienceSecretRetriever
(
audience
->
null
);
assertThrows
(
TokenRequestException
.
class
,
()
->
tokenGenerator
.
generateAccessToken
(
accessTokenRequest
),
"Unsupported issuer"
);
}
}
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