Search in sources :

Example 1 with BerlinGroupRequestProvider

use of net.petafuel.styx.core.xs2a.standards.berlingroup.v1_2.BerlinGroupRequestProvider in project styx by petafuel.

the class BerlinGroupRequestFactoryTest method testAISConsentCreation.

@Test
void testAISConsentCreation() {
    UUID uuid = UUID.randomUUID();
    ThreadContext.put("requestUUID", uuid.toString());
    BerlinGroupRequestProvider berlinGroupRequestProvider = new BerlinGroupRequestProvider();
    AISRequestFactory requestFactory = new AISRequestFactory();
    XS2AFactoryInput factoryInput = new XS2AFactoryInput();
    Consent consent = new Consent();
    consent.setxRequestId(uuid);
    factoryInput.setConsent(consent);
    AISRequest berlinGroupAccountList = requestFactory.create(berlinGroupRequestProvider.consentCreation(), factoryInput);
    Assertions.assertTrue(berlinGroupAccountList instanceof CreateConsentRequest);
    Assertions.assertNotNull(berlinGroupAccountList.getTppRedirectUri());
    Assertions.assertTrue(berlinGroupAccountList.getTppRedirectUri().contains(uuid.toString()));
    Assertions.assertTrue(berlinGroupAccountList.getTppRedirectUri().contains(RealmParameter.OK.name().toLowerCase()));
    Assertions.assertNotNull(berlinGroupAccountList.getTppNokRedirectUri());
    Assertions.assertTrue(berlinGroupAccountList.getTppNokRedirectUri().contains(uuid.toString()));
    Assertions.assertTrue(berlinGroupAccountList.getTppNokRedirectUri().contains(RealmParameter.FAILED.name().toLowerCase()));
}
Also used : Consent(net.petafuel.styx.core.xs2a.entities.Consent) BerlinGroupRequestProvider(net.petafuel.styx.core.xs2a.standards.berlingroup.v1_2.BerlinGroupRequestProvider) AISRequest(net.petafuel.styx.core.xs2a.contracts.AISRequest) UUID(java.util.UUID) CreateConsentRequest(net.petafuel.styx.core.xs2a.standards.berlingroup.v1_2.http.CreateConsentRequest) Test(org.junit.jupiter.api.Test)

Example 2 with BerlinGroupRequestProvider

use of net.petafuel.styx.core.xs2a.standards.berlingroup.v1_2.BerlinGroupRequestProvider in project styx by petafuel.

the class BerlinGroupRequestFactoryTest method testAISRequestFactory.

@Test
void testAISRequestFactory() {
    BerlinGroupRequestProvider berlinGroupRequestProvider = new BerlinGroupRequestProvider();
    AISRequestFactory requestFactory = new AISRequestFactory();
    XS2AFactoryInput factoryInput = new XS2AFactoryInput();
    AISRequest berlinGroupAccountList = requestFactory.create(berlinGroupRequestProvider.accountList(), factoryInput);
    Assertions.assertTrue(berlinGroupAccountList instanceof ReadAccountListRequest);
}
Also used : BerlinGroupRequestProvider(net.petafuel.styx.core.xs2a.standards.berlingroup.v1_2.BerlinGroupRequestProvider) AISRequest(net.petafuel.styx.core.xs2a.contracts.AISRequest) ReadAccountListRequest(net.petafuel.styx.core.xs2a.standards.berlingroup.v1_2.http.ReadAccountListRequest) Test(org.junit.jupiter.api.Test)

Aggregations

AISRequest (net.petafuel.styx.core.xs2a.contracts.AISRequest)2 BerlinGroupRequestProvider (net.petafuel.styx.core.xs2a.standards.berlingroup.v1_2.BerlinGroupRequestProvider)2 Test (org.junit.jupiter.api.Test)2 UUID (java.util.UUID)1 Consent (net.petafuel.styx.core.xs2a.entities.Consent)1 CreateConsentRequest (net.petafuel.styx.core.xs2a.standards.berlingroup.v1_2.http.CreateConsentRequest)1 ReadAccountListRequest (net.petafuel.styx.core.xs2a.standards.berlingroup.v1_2.http.ReadAccountListRequest)1