use of com.forgerock.openbanking.model.DirectorySoftwareStatement in project openbanking-aspsp by OpenBankingToolkit.
the class TppRegistrationServiceTest method shouldFailWhenNoRedirectUrlInSsa_verifyTppRegistrationRequestAgainstSSA.
/**
*************************** test redirect url logic ***********************************************************
*/
// ToDo: This is ignored due to issue: https://github.com/OpenBankingToolkit/openbanking-toolkit/issues/17
@Test
@Ignore
public void shouldFailWhenNoRedirectUrlInSsa_verifyTppRegistrationRequestAgainstSSA() throws DynamicClientRegistrationException {
// Given
DynamicClientRegistrationException dcre = new DynamicClientRegistrationException("Test throw", DynamicClientRegistrationErrorType.INVALID_REDIRECT_URI);
DirectorySoftwareStatement directorySoftwareStatement = TestHelperFunctions.getValidFRDirectorySoftwareStatement();
RegistrationRequest regRequest = new RegistrationRequest();
regRequest.setSoftwareId(directorySoftwareStatement.getSoftware_client_id());
regRequest.setRedirectUris(directorySoftwareStatement.getSoftware_redirect_uris());
regRequest.setSoftwareStatement(TestHelperFunctions.getValidSsaSerialised());
regRequest.setDirectorySoftwareStatement(directorySoftwareStatement);
RegistrationRequest spyRequest = spy(regRequest);
when(spyRequest.getRedirectUrisFromSSA()).thenReturn(Optional.empty());
// When
DynamicClientRegistrationException exception = catchThrowableOfType(() -> tppRegistrationService.verifyTPPRegistrationRequestAgainstSSA(spyRequest), DynamicClientRegistrationException.class);
// Then
assertThat(exception.getErrorType()).isEqualTo(DynamicClientRegistrationErrorType.INVALID_REDIRECT_URI);
}
Aggregations