Package net.officefloor.web.jwt.mock
Class AbstractMockJwtAccessTokenJUnit
- java.lang.Object
-
- net.officefloor.web.jwt.mock.AbstractMockJwtAccessTokenJUnit
-
- Direct Known Subclasses:
MockJwtAccessTokenExtension
,MockJwtAccessTokenRule
public abstract class AbstractMockJwtAccessTokenJUnit extends java.lang.Object
Abstract JUnit mock JWT access tokens for the
JwtHttpSecuritySource
.This allows generating access tokens for testing the application.
- Author:
- Daniel Sagenschneider
-
-
Constructor Summary
Constructors Constructor Description AbstractMockJwtAccessTokenJUnit()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MockHttpRequestBuilder
authorize(java.lang.Object claims, MockHttpRequestBuilder requestBuilder)
java.lang.String
createAccessToken(java.lang.Object claims)
Creates the access token.JwtValidateKey[]
getActiveJwtValidateKeys()
Obtains the activeJwtValidateKey
instances.protected void
setupMockKeys()
Setups up the mock JWT keys.protected void
teardownMockKeys()
Tears down the mock JWT keys.
-
-
-
Method Detail
-
createAccessToken
public java.lang.String createAccessToken(java.lang.Object claims)
Creates the access token.- Parameters:
claims
- Claims for the access token.- Returns:
- Access token.
-
getActiveJwtValidateKeys
public JwtValidateKey[] getActiveJwtValidateKeys()
Obtains the activeJwtValidateKey
instances.- Returns:
- Active
JwtValidateKey
instances.
-
authorize
public MockHttpRequestBuilder authorize(java.lang.Object claims, MockHttpRequestBuilder requestBuilder)
- Parameters:
claims
- Claims for the access token.requestBuilder
-MockHttpRequestBuilder
.- Returns:
MockHttpRequestBuilder
withHttpHeader
configured.
-
setupMockKeys
protected void setupMockKeys()
Setups up the mock JWT keys.
-
teardownMockKeys
protected void teardownMockKeys()
Tears down the mock JWT keys.
-
-