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()));
}
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);
}
Aggregations