Class IssueRegistrationAccessTokenFlowTest
- java.lang.Object
-
- org.springframework.test.context.testng.AbstractTestNGSpringContextTests
-
- net.shibboleth.idp.test.flows.AbstractFlowTest
-
- net.shibboleth.idp.plugin.oidc.op.profile.flow.AbstractOidcFlowTest
-
- net.shibboleth.idp.plugin.oidc.op.profile.flow.IssueRegistrationAccessTokenFlowTest
-
- All Implemented Interfaces:
Aware,ApplicationContextAware,IHookable,ITestNGListener
public class IssueRegistrationAccessTokenFlowTest extends AbstractOidcFlowTest
issue-registration-access-token flow test.
-
-
Field Summary
Fields Modifier and Type Field Description static StringFLOW_IDThe flow id.-
Fields inherited from class net.shibboleth.idp.plugin.oidc.op.profile.flow.AbstractOidcFlowTest
END_STATE_ID
-
Fields inherited from class net.shibboleth.idp.test.flows.AbstractFlowTest
builderFactory, certFactoryBean, directoryServer, END_STATE_OUTPUT_ATTR_EXPR, END_STATE_OUTPUT_ATTR_NAME, externalContext, flowExecutor, idGenerator, IDP_ENTITY_ID, idpCredential, IP_ADDRESS_AUTHN_FLOW_ID, IP_ADDRESS_AUTHN_MAP_BEAN_NAME, KEYSTORE_FILE, LDIF_FILE, marshallerFactory, parserPool, request, response, SAML1_TRANSFORM_C14N_BEAN_NAME, SAML2_TRANSFORM_C14N_BEAN_NAME, SP_ACS_URL, SP_ENTITY_ID, SP_RELAY_STATE, spCredential, unmarshallerFactory
-
Fields inherited from class org.springframework.test.context.testng.AbstractTestNGSpringContextTests
applicationContext, logger
-
-
Constructor Summary
Constructors Constructor Description IssueRegistrationAccessTokenFlowTest()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidassertErrorResponse(int status, String title)private Map<String,net.shibboleth.oidc.metadata.policy.MetadataPolicy>buildMetadataPolicy1()private voidbuildRequest(String lifetime, String metadataLocation, String relyingPartyId, String clientId, String replacement)voidtestWithInvalidLocation()Test the flow with invalid metadata location in the parameters.voidtestWithNoParameters()Test the flow without any parameters.voidtestWithPolicyIdClientId()Test the flow with policy ID in the parameters, without policy location.voidtestWithPolicyIdOnly()Test the flow with policy ID in the parameters, without policy location.voidtestWithPolicyIdReplacemenSetWithClientId()Test the flow with policy ID in the parameters, without policy location.voidtestWithPolicyIdReplacementIgnoredWithoutClientId()Test the flow with policy ID in the parameters, without policy location.voidtestWithPolicyLocationOnly()Test the flow with both policy location in the parameters, without policy ID.voidtestWithValidPolicyLocationAndId()Test the flow with both policy ID and policy location in the parameters.protected RegistrationClaimsSetvalidateToken(com.nimbusds.oauth2.sdk.AccessTokenResponse tokenResponse, String policyId, String clientId, Map<String,net.shibboleth.oidc.metadata.policy.MetadataPolicy> policy)-
Methods inherited from class net.shibboleth.idp.plugin.oidc.op.profile.flow.AbstractOidcFlowTest
assertErrorCode, assertErrorDescriptionContains, buildJsonForLegacyToken, createPrivateKeyJWT, createSecretJWT, getDataSealer, initializeMocks, initializeThreadLocals, parseErrorResponse, parseResponse, parseSuccessResponse, removeMetadata, setBasicAuth, setHttpFormRequest, setJsonRequest, setRequest, storeConsent, storeMetadata, storeMetadata, storeMetadata, storeMetadata, storeMetadata
-
Methods inherited from class net.shibboleth.idp.test.flows.AbstractFlowTest
assertFlowExecutionOutcome, assertFlowExecutionOutcome, assertFlowExecutionResult, assertProfileRequestContext, buildSOAP11Envelope, clearThreadLocals, getFlow, initializeFlowExecutor, initializeXMLObjectSupport, overrideEndStateOutput, overrideEndStateOutput, registerFlowsInParentRegistry, retrieveProfileRequestContext, setupDirectoryServer, teardownDirectoryServer
-
Methods inherited from class org.springframework.test.context.testng.AbstractTestNGSpringContextTests
run, setApplicationContext, springTestContextAfterTestClass, springTestContextAfterTestMethod, springTestContextBeforeTestClass, springTestContextBeforeTestMethod, springTestContextPrepareTestInstance
-
-
-
-
Field Detail
-
FLOW_ID
@Nonnull public static final String FLOW_ID
The flow id.- See Also:
- Constant Field Values
-
-
Method Detail
-
testWithNoParameters
public void testWithNoParameters() throws ExceptionTest the flow without any parameters.- Throws:
Exception- if an error occurs
-
testWithInvalidLocation
public void testWithInvalidLocation() throws ExceptionTest the flow with invalid metadata location in the parameters.- Throws:
Exception- if an error occurs
-
testWithValidPolicyLocationAndId
public void testWithValidPolicyLocationAndId() throws ExceptionTest the flow with both policy ID and policy location in the parameters.- Throws:
Exception- if an error occurs
-
testWithPolicyLocationOnly
public void testWithPolicyLocationOnly() throws ExceptionTest the flow with both policy location in the parameters, without policy ID.- Throws:
Exception- if an error occurs
-
testWithPolicyIdOnly
public void testWithPolicyIdOnly() throws ExceptionTest the flow with policy ID in the parameters, without policy location.- Throws:
Exception- if an error occurs
-
testWithPolicyIdClientId
public void testWithPolicyIdClientId() throws ExceptionTest the flow with policy ID in the parameters, without policy location. Client ID is set.- Throws:
Exception- if an error occurs
-
testWithPolicyIdReplacementIgnoredWithoutClientId
public void testWithPolicyIdReplacementIgnoredWithoutClientId() throws ExceptionTest the flow with policy ID in the parameters, without policy location. Client ID is not set so replacement should be null even when set in the request.- Throws:
Exception- if an error occurs
-
testWithPolicyIdReplacemenSetWithClientId
public void testWithPolicyIdReplacemenSetWithClientId() throws ExceptionTest the flow with policy ID in the parameters, without policy location. Client ID is set so replacement can be set too.- Throws:
Exception- if an error occurs
-
validateToken
protected RegistrationClaimsSet validateToken(com.nimbusds.oauth2.sdk.AccessTokenResponse tokenResponse, String policyId, String clientId, Map<String,net.shibboleth.oidc.metadata.policy.MetadataPolicy> policy) throws Exception
- Throws:
Exception
-
buildMetadataPolicy1
private Map<String,net.shibboleth.oidc.metadata.policy.MetadataPolicy> buildMetadataPolicy1()
-
buildRequest
private void buildRequest(@Nullable String lifetime, @Nullable String metadataLocation, @Nullable String relyingPartyId, @Nullable String clientId, @Nullable String replacement) throws UnsupportedEncodingException- Throws:
UnsupportedEncodingException
-
assertErrorResponse
private 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
-
-