Search in sources :

Example 1 with Tpp

use of com.forgerock.openbanking.model.Tpp in project openbanking-aspsp by OpenBankingToolkit.

the class TppRegistrationServiceTest method ensureTppOwnsOidcRegistration.

@Test
public void ensureTppOwnsOidcRegistration() throws OAuth2InvalidClientException {
    // Given
    String clientId = "ClientId";
    String clientName = "Name";
    String authorizationNumber = "PSDUK-FCA-12345";
    Tpp tpp = TestHelperFunctions.getValidTpp(clientId, clientName);
    tpp.setAuthorisationNumber(authorizationNumber);
    // When
    tppRegistrationService.ensureTppOwnsOidcRegistration(tpp, authorizationNumber);
// Then
}
Also used : Tpp(com.forgerock.openbanking.model.Tpp) Test(org.junit.Test)

Example 2 with Tpp

use of com.forgerock.openbanking.model.Tpp in project openbanking-aspsp by OpenBankingToolkit.

the class TppRegistrationServiceTest method ensureTppOwnsOidcRegistration_ThrowsWhenNoMatch.

@Test
public void ensureTppOwnsOidcRegistration_ThrowsWhenNoMatch() throws OAuth2InvalidClientException {
    // Given
    String clientId = "ClientId";
    String clientName = "Name";
    String authorizationNumber = "PSDUK-FCA-12345";
    Tpp tpp = TestHelperFunctions.getValidTpp(clientId, clientName);
    tpp.setAuthorisationNumber(authorizationNumber);
    // When
    Exception e = catchThrowableOfType(() -> tppRegistrationService.ensureTppOwnsOidcRegistration(tpp, "PSDUK-FCA" + "-54321"), Exception.class);
    // Then
    assertThat(e).isNotNull();
    assertThat(e).isInstanceOf(OAuth2InvalidClientException.class);
}
Also used : Tpp(com.forgerock.openbanking.model.Tpp) DynamicClientRegistrationException(com.forgerock.openbanking.common.error.exception.dynamicclientregistration.DynamicClientRegistrationException) OAuth2InvalidClientException(com.forgerock.openbanking.common.error.exception.oauth2.OAuth2InvalidClientException) OBErrorException(com.forgerock.openbanking.exceptions.OBErrorException) OIDCException(com.forgerock.openbanking.exceptions.OIDCException) Test(org.junit.Test)

Example 3 with Tpp

use of com.forgerock.openbanking.model.Tpp in project openbanking-aspsp by OpenBankingToolkit.

the class TppRegistrationServiceTest method getTpp_success.

@Test
public void getTpp_success() throws OAuth2InvalidClientException {
    // Given
    String clientId = "clientId";
    when(tppStoreService.findByClientId(clientId)).thenReturn(Optional.of(TestHelperFunctions.getValidTpp(clientId, "tppName")));
    // When
    Tpp tpp = tppRegistrationService.getTpp(clientId);
    // Then
    assertThat(tpp).isNotNull();
    assertThat(tpp.getClientId()).isEqualTo(clientId);
}
Also used : Tpp(com.forgerock.openbanking.model.Tpp) Test(org.junit.Test)

Example 4 with Tpp

use of com.forgerock.openbanking.model.Tpp in project openbanking-aspsp by OpenBankingToolkit.

the class TransactionsApiControllerIT method setUp.

@Before
public void setUp() {
    Unirest.config().setObjectMapper(new JacksonObjectMapper()).verifySsl(false);
    tpp = new Tpp();
    tpp.setClientId(CLIENT_ID);
    tpp.setAuthorisationNumber(AUTHORISATION_NUMBER);
}
Also used : JacksonObjectMapper(kong.unirest.JacksonObjectMapper) Tpp(com.forgerock.openbanking.model.Tpp) Before(org.junit.Before)

Example 5 with Tpp

use of com.forgerock.openbanking.model.Tpp in project openbanking-aspsp by OpenBankingToolkit.

the class TransactionsApiControllerIT method setUp.

@Before
public void setUp() {
    Unirest.config().setObjectMapper(new JacksonObjectMapper()).verifySsl(false);
    tpp = new Tpp();
    tpp.setClientId(CLIENT_ID);
    tpp.setAuthorisationNumber(AUTHORISATION_NUMBER);
}
Also used : JacksonObjectMapper(kong.unirest.JacksonObjectMapper) Tpp(com.forgerock.openbanking.model.Tpp) Before(org.junit.Before)

Aggregations

Tpp (com.forgerock.openbanking.model.Tpp)131 ConsentStatusEntry (com.forgerock.openbanking.analytics.model.entries.ConsentStatusEntry)39 Test (org.junit.Test)28 OIDCRegistrationResponse (com.forgerock.openbanking.model.oidc.OIDCRegistrationResponse)19 Before (org.junit.Before)13 SpringSecForTest (com.forgerock.openbanking.integration.test.support.SpringSecForTest)12 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)12 JacksonObjectMapper (kong.unirest.JacksonObjectMapper)11 OAuth2InvalidClientException (com.forgerock.openbanking.common.error.exception.oauth2.OAuth2InvalidClientException)9 OBErrorException (com.forgerock.openbanking.exceptions.OBErrorException)9 OBErrorResponseException (com.forgerock.openbanking.exceptions.OBErrorResponseException)9 AccountWithBalance (com.forgerock.openbanking.common.model.openbanking.persistence.account.AccountWithBalance)8 URI (java.net.URI)8 FRInternationalStandingOrderConsent (com.forgerock.openbanking.common.model.openbanking.persistence.payment.FRInternationalStandingOrderConsent)7 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)7 UriComponentsBuilder (org.springframework.web.util.UriComponentsBuilder)7 FRWriteInternationalStandingOrderConsent (com.forgerock.openbanking.common.model.openbanking.domain.payment.FRWriteInternationalStandingOrderConsent)6 FRDomesticConsent (com.forgerock.openbanking.common.model.openbanking.persistence.payment.FRDomesticConsent)6 FRDomesticScheduledConsent (com.forgerock.openbanking.common.model.openbanking.persistence.payment.FRDomesticScheduledConsent)6 FRDomesticStandingOrderConsent (com.forgerock.openbanking.common.model.openbanking.persistence.payment.FRDomesticStandingOrderConsent)6