Search in sources :

Example 1 with FREventNotification

use of com.forgerock.openbanking.common.model.openbanking.persistence.event.FREventNotification in project openbanking-aspsp by OpenBankingToolkit.

the class SignedJwtEventBuilderTest method buildClaimsForInternationalPayment_validJwtClaimsBuilt.

@Test
public void buildClaimsForInternationalPayment_validJwtClaimsBuilt() {
    // Given
    EventSubject subject = getEventSubject("PIC_123", "v3.1", "international-payment");
    // When
    FREventNotification eventNotification = signedJwtEventBuilder.build(TPP, subject, EventType.RESOURCE_UPDATE_EVENT);
    // Then
    assertThat(eventNotification.getSignedJwt()).isEqualTo(FAKE_SIGNED_JWT);
    areClaimsValidForConsentId(subject.getId(), "/v3.1/international-payments", "international-payment", "v3.1");
}
Also used : FREventNotification(com.forgerock.openbanking.common.model.openbanking.persistence.event.FREventNotification) EventSubject(com.forgerock.openbanking.common.services.notification.EventSubject) Test(org.junit.Test)

Example 2 with FREventNotification

use of com.forgerock.openbanking.common.model.openbanking.persistence.event.FREventNotification in project openbanking-aspsp by OpenBankingToolkit.

the class SignedJwtEventBuilderTest method buildClaimsForSinglePayment_validJwtClaimsBuilt.

@Test
public void buildClaimsForSinglePayment_validJwtClaimsBuilt() {
    // Given
    EventSubject subject = EventSubject.builder().id("PR_123").url(BASE_URL + "/v2.0/single-payments/PR_123").type("single-payment").version("v2.0").build();
    // When
    FREventNotification eventNotification = signedJwtEventBuilder.build(TPP, subject, EventType.RESOURCE_UPDATE_EVENT);
    // Then
    assertThat(eventNotification.getSignedJwt()).isEqualTo(FAKE_SIGNED_JWT);
    areClaimsValidForConsentId(subject.getId(), "/v2.0/single-payments", "single-payment", "v2.0");
}
Also used : FREventNotification(com.forgerock.openbanking.common.model.openbanking.persistence.event.FREventNotification) EventSubject(com.forgerock.openbanking.common.services.notification.EventSubject) Test(org.junit.Test)

Example 3 with FREventNotification

use of com.forgerock.openbanking.common.model.openbanking.persistence.event.FREventNotification in project openbanking-aspsp by OpenBankingToolkit.

the class SignedJwtEventBuilderTest method buildClaimsForDomesticScheduledPayment_validJwtClaimsBuilt.

@Test
public void buildClaimsForDomesticScheduledPayment_validJwtClaimsBuilt() {
    // Given
    EventSubject subject = getEventSubject("PISC_123", "v3.1", "domestic-scheduled-payment");
    // When
    FREventNotification eventNotification = signedJwtEventBuilder.build(TPP, subject, EventType.RESOURCE_UPDATE_EVENT);
    // Then
    assertThat(eventNotification.getSignedJwt()).isEqualTo(FAKE_SIGNED_JWT);
    areClaimsValidForConsentId(subject.getId(), "/v3.1/domestic-scheduled-payments", "domestic-scheduled-payment", "v3.1");
}
Also used : FREventNotification(com.forgerock.openbanking.common.model.openbanking.persistence.event.FREventNotification) EventSubject(com.forgerock.openbanking.common.services.notification.EventSubject) Test(org.junit.Test)

Example 4 with FREventNotification

use of com.forgerock.openbanking.common.model.openbanking.persistence.event.FREventNotification in project openbanking-aspsp by OpenBankingToolkit.

the class SignedJwtEventBuilderTest method buildClaimsForDomesticStandingOrder_validJwtClaimsBuilt.

@Test
public void buildClaimsForDomesticStandingOrder_validJwtClaimsBuilt() {
    // Given
    EventSubject subject = getEventSubject("PISC_123", "v3.1", "domestic-standing-order");
    // When
    FREventNotification eventNotification = signedJwtEventBuilder.build(TPP, subject, EventType.RESOURCE_UPDATE_EVENT);
    // Then
    assertThat(eventNotification.getSignedJwt()).isEqualTo(FAKE_SIGNED_JWT);
    areClaimsValidForConsentId(subject.getId(), "/v3.1/domestic-standing-orders", "domestic-standing-order", "v3.1");
}
Also used : FREventNotification(com.forgerock.openbanking.common.model.openbanking.persistence.event.FREventNotification) EventSubject(com.forgerock.openbanking.common.services.notification.EventSubject) Test(org.junit.Test)

Example 5 with FREventNotification

use of com.forgerock.openbanking.common.model.openbanking.persistence.event.FREventNotification in project openbanking-aspsp by OpenBankingToolkit.

the class SignedJwtEventBuilderTest method buildClaimsForDomesticPayment_validJwtClaimsBuilt.

@Test
public void buildClaimsForDomesticPayment_validJwtClaimsBuilt() {
    // Given
    EventSubject subject = getEventSubject("PISC_123", "v3.1", "domestic-payment");
    // When
    FREventNotification eventNotification = signedJwtEventBuilder.build(TPP, subject, EventType.RESOURCE_UPDATE_EVENT);
    // Then
    assertThat(eventNotification.getSignedJwt()).isEqualTo(FAKE_SIGNED_JWT);
    areClaimsValidForConsentId(subject.getId(), "/v3.1/domestic-payments", "domestic-payment", "v3.1");
}
Also used : FREventNotification(com.forgerock.openbanking.common.model.openbanking.persistence.event.FREventNotification) EventSubject(com.forgerock.openbanking.common.services.notification.EventSubject) Test(org.junit.Test)

Aggregations

FREventNotification (com.forgerock.openbanking.common.model.openbanking.persistence.event.FREventNotification)21 Test (org.junit.Test)17 EventSubject (com.forgerock.openbanking.common.services.notification.EventSubject)8 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)7 SpringSecForTest (com.forgerock.openbanking.integration.test.support.SpringSecForTest)6 OBEventPolling1 (uk.org.openbanking.datamodel.event.OBEventPolling1)6 OBEventPollingResponse1 (uk.org.openbanking.datamodel.event.OBEventPollingResponse1)6 FREventPolling (com.forgerock.openbanking.common.model.openbanking.domain.event.FREventPolling)3 FRDataEvent (com.forgerock.openbanking.common.model.data.FRDataEvent)2 FREventSubscription (com.forgerock.openbanking.common.model.openbanking.persistence.event.FREventSubscription)2 OBErrorException (com.forgerock.openbanking.exceptions.OBErrorException)2 Slf4j (lombok.extern.slf4j.Slf4j)2 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 AMOpenBankingConfiguration (com.forgerock.openbanking.am.config.AMOpenBankingConfiguration)1 CallBackCounterEntry (com.forgerock.openbanking.analytics.model.entries.callback.CallBackCounterEntry)1 CallBackResponseStatus (com.forgerock.openbanking.analytics.model.entries.callback.CallBackResponseStatus)1 CallBackCountersKPIService (com.forgerock.openbanking.analytics.services.CallBackCountersKPIService)1 AggregatedPollingService (com.forgerock.openbanking.aspsp.rs.simulator.event.store.AggregatedPollingService)1 CallbackUrlsService (com.forgerock.openbanking.aspsp.rs.simulator.event.store.CallbackUrlsService)1