Class IssueRegistrationAccessTokenTest
- java.lang.Object
-
- net.shibboleth.idp.plugin.oidc.op.admin.impl.IssueRegistrationAccessTokenTest
-
public class IssueRegistrationAccessTokenTest extends Object
Unit tests forIssueRegistrationAccessToken.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classIssueRegistrationAccessTokenTest.MockAccessControlServiceMock service for ACL checks.
-
Field Summary
Fields Modifier and Type Field Description private AccessControlServiceaccessControlServiceprivate net.shibboleth.idp.plugin.oidc.op.admin.impl.IssueRegistrationAccessTokenactionprivate StringclientIdprivate DataSealerdataSealerprivate MockHttpServletRequesthttpRequestprivate MockHttpServletResponsehttpResponseprivate Stringissuerprivate Stringlifetimeprivate com.fasterxml.jackson.databind.ObjectMapperobjectMapperprivate ProfileRequestContextprcprivate StringrelyingPartyIdprivate RequestContextrequestCtx
-
Constructor Summary
Constructors Constructor Description IssueRegistrationAccessTokenTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidassertErrorResponse(int status, String title)protected voidassertInstantWithSkew(Instant instant, Instant target)protected Map<String,net.shibboleth.oidc.metadata.policy.MetadataPolicy>defaultMetadataPolicy()voidinit()voidinitOnce()protected voidinitRequestResponse()voidtestInvalidMetadataPolicyLocation()voidtestNoMetadataPolicyLookup()voidtestNoMetadataPolicyNorId()voidtestNoObjectMapper()voidtestNoSealer()voidtestNoTokenLifetime()voidtestSuccessNoPolicyId()voidtestSuccessWithClientIdPolicyId()voidtestSuccessWithPolicyId()protected voidvalidateToken(String policyId, String clientId)
-
-
-
Field Detail
-
action
private net.shibboleth.idp.plugin.oidc.op.admin.impl.IssueRegistrationAccessToken action
-
requestCtx
private RequestContext requestCtx
-
prc
private ProfileRequestContext prc
-
dataSealer
private DataSealer dataSealer
-
objectMapper
private com.fasterxml.jackson.databind.ObjectMapper objectMapper
-
accessControlService
private AccessControlService accessControlService
-
issuer
private String issuer
-
relyingPartyId
private String relyingPartyId
-
clientId
private String clientId
-
lifetime
private String lifetime
-
httpRequest
private MockHttpServletRequest httpRequest
-
httpResponse
private MockHttpServletResponse httpResponse
-
-
Method Detail
-
initOnce
@BeforeClass public void initOnce()
-
init
@BeforeMethod public void init() throws ComponentInitializationException, NoSuchAlgorithmException
-
initRequestResponse
protected void initRequestResponse()
-
defaultMetadataPolicy
protected Map<String,net.shibboleth.oidc.metadata.policy.MetadataPolicy> defaultMetadataPolicy()
-
testNoSealer
public void testNoSealer() throws ComponentInitializationException- Throws:
ComponentInitializationException
-
testNoObjectMapper
public void testNoObjectMapper() throws ComponentInitializationException- Throws:
ComponentInitializationException
-
testNoMetadataPolicyLookup
public void testNoMetadataPolicyLookup() throws ComponentInitializationException- Throws:
ComponentInitializationException
-
testNoMetadataPolicyNorId
public void testNoMetadataPolicyNorId() throws ComponentInitializationException, com.fasterxml.jackson.databind.JsonMappingException, com.fasterxml.jackson.core.JsonProcessingException, UnsupportedEncodingException- Throws:
ComponentInitializationExceptioncom.fasterxml.jackson.databind.JsonMappingExceptioncom.fasterxml.jackson.core.JsonProcessingExceptionUnsupportedEncodingException
-
testInvalidMetadataPolicyLocation
public void testInvalidMetadataPolicyLocation() throws ComponentInitializationException, com.fasterxml.jackson.databind.JsonMappingException, com.fasterxml.jackson.core.JsonProcessingException, UnsupportedEncodingException- Throws:
ComponentInitializationExceptioncom.fasterxml.jackson.databind.JsonMappingExceptioncom.fasterxml.jackson.core.JsonProcessingExceptionUnsupportedEncodingException
-
testNoTokenLifetime
public void testNoTokenLifetime() throws DataSealerException, com.fasterxml.jackson.databind.JsonMappingException, com.fasterxml.jackson.core.JsonProcessingException- Throws:
DataSealerExceptioncom.fasterxml.jackson.databind.JsonMappingExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
testSuccessNoPolicyId
public void testSuccessNoPolicyId() throws DataSealerException, com.fasterxml.jackson.databind.JsonMappingException, com.fasterxml.jackson.core.JsonProcessingException- Throws:
DataSealerExceptioncom.fasterxml.jackson.databind.JsonMappingExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
testSuccessWithPolicyId
public void testSuccessWithPolicyId() throws DataSealerException, com.fasterxml.jackson.databind.JsonMappingException, com.fasterxml.jackson.core.JsonProcessingException- Throws:
DataSealerExceptioncom.fasterxml.jackson.databind.JsonMappingExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
testSuccessWithClientIdPolicyId
public void testSuccessWithClientIdPolicyId() throws DataSealerException, com.fasterxml.jackson.databind.JsonMappingException, com.fasterxml.jackson.core.JsonProcessingException- Throws:
DataSealerExceptioncom.fasterxml.jackson.databind.JsonMappingExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
validateToken
protected void validateToken(String policyId, String clientId) throws DataSealerException, com.fasterxml.jackson.databind.JsonMappingException, com.fasterxml.jackson.core.JsonProcessingException
- Throws:
DataSealerExceptioncom.fasterxml.jackson.databind.JsonMappingExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
assertErrorResponse
protected void assertErrorResponse(int status, String title) throws UnsupportedEncodingException, com.fasterxml.jackson.databind.JsonMappingException, com.fasterxml.jackson.core.JsonProcessingException- Throws:
UnsupportedEncodingExceptioncom.fasterxml.jackson.databind.JsonMappingExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
-