Search in sources :

Example 1 with Config

use of net.petafuel.styx.core.banklookup.sad.entities.Config in project styx by petafuel.

the class STYX09IntegrationTest method configure.

@Override
protected Application configure() {
    styx09Option = new ImplementerOption();
    styx09Option.setId("STYX09");
    ing = new Aspsp();
    ing.setConfig(new Config());
    ing.setBic(TEST_BIC);
    Url url = new Url();
    url.setCommonUrl("https://api.sandbox.ing.com");
    ing.setSandboxUrl(url);
    ResourceConfig config = setupFiltersAndErrorHandlers();
    if (pisAccessToken == null || Objects.equals(pisAccessToken, "")) {
        Assertions.fail("test.token.access.pis not set in test properties");
    }
    return config.register(AuthenticationResource.class).register(PaymentInitiationResource.class);
}
Also used : Aspsp(net.petafuel.styx.core.banklookup.sad.entities.Aspsp) Config(net.petafuel.styx.core.banklookup.sad.entities.Config) ResourceConfig(org.glassfish.jersey.server.ResourceConfig) ResourceConfig(org.glassfish.jersey.server.ResourceConfig) ImplementerOption(net.petafuel.styx.core.banklookup.sad.entities.ImplementerOption) Url(net.petafuel.styx.core.banklookup.sad.entities.Url) AuthenticationResource(net.petafuel.styx.api.v1.authentication.boundary.AuthenticationResource)

Example 2 with Config

use of net.petafuel.styx.core.banklookup.sad.entities.Config in project styx by petafuel.

the class STYX10UnitTest method setup.

@BeforeAll
static void setup() {
    styx10Option = new ImplementerOption();
    styx10Option.setId("STYX10");
    uniCredit = new Aspsp();
    uniCredit.setConfig(new Config());
}
Also used : Aspsp(net.petafuel.styx.core.banklookup.sad.entities.Aspsp) Config(net.petafuel.styx.core.banklookup.sad.entities.Config) ImplementerOption(net.petafuel.styx.core.banklookup.sad.entities.ImplementerOption) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 3 with Config

use of net.petafuel.styx.core.banklookup.sad.entities.Config in project styx by petafuel.

the class STYX08UnitTest method setup.

@BeforeAll
static void setup() {
    styx08Option = new ImplementerOption();
    styx08Option.setId("STYX08");
    uniCredit = new Aspsp();
    uniCredit.setConfig(new Config());
    uniCredit.setBic(TEST_BIC);
}
Also used : Aspsp(net.petafuel.styx.core.banklookup.sad.entities.Aspsp) Config(net.petafuel.styx.core.banklookup.sad.entities.Config) ImplementerOption(net.petafuel.styx.core.banklookup.sad.entities.ImplementerOption) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 4 with Config

use of net.petafuel.styx.core.banklookup.sad.entities.Config in project styx by petafuel.

the class IO2UnitTest method setup.

@BeforeAll
static void setup() {
    io2Option = new ImplementerOption();
    io2Option.setId("IO2");
    aspsp = new Aspsp();
    aspsp.setConfig(new Config());
    aspsp.setBic(TEST_BIC);
}
Also used : Aspsp(net.petafuel.styx.core.banklookup.sad.entities.Aspsp) Config(net.petafuel.styx.core.banklookup.sad.entities.Config) ImplementerOption(net.petafuel.styx.core.banklookup.sad.entities.ImplementerOption) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 5 with Config

use of net.petafuel.styx.core.banklookup.sad.entities.Config in project styx by petafuel.

the class ApplicableIOTest method testExecutionContext.

@Test
void testExecutionContext() throws ImplementerOptionException {
    class TEST1 extends ApplicableImplementerOption {

        protected TEST1(IOParser ioParser) {
            super(ioParser);
        // TODO Auto-generated constructor stub
        }

        @Override
        public boolean apply(XS2AFactoryInput xs2aFactoryInput, XS2ARequest xs2aRequest, XS2AResponse xs2aResponse) throws ImplementerOptionException {
            // TODO Auto-generated method stub
            return false;
        }

        @Override
        public IOOrder order() {
            // TODO Auto-generated method stub
            return null;
        }
    }
    ;
    ImplementerOption test1 = new ImplementerOption();
    test1.setId("TEST1");
    Aspsp aspsp = new Aspsp();
    aspsp.setConfig(new Config());
    aspsp.setBic("TEST7999");
    test1.setOptions(Collections.singletonMap("KEEP_ALIVE", true));
    aspsp.getConfig().setImplementerOptions(Collections.singletonMap("TEST1", test1));
    IOParser ioParser = new IOParser(aspsp);
    TEST1 aio = new TEST1(ioParser);
    assertTrue(aio.shouldExecute(StyxExecutionContext.API));
    assertTrue(aio.shouldExecute(StyxExecutionContext.KEEP_ALIVE));
    aspsp.getConfig().getImplementerOptions().get("TEST1").setOptions(Collections.singletonMap("KEEP_ALIVE", false));
    assertTrue(aio.shouldExecute(StyxExecutionContext.API));
    assertFalse(aio.shouldExecute(StyxExecutionContext.KEEP_ALIVE));
    aspsp.getConfig().getImplementerOptions().get("TEST1").setOptions(Collections.singletonMap("required", false));
    assertTrue(aio.shouldExecute(StyxExecutionContext.API));
    assertFalse(aio.shouldExecute(StyxExecutionContext.KEEP_ALIVE));
    assertFalse(aio.shouldExecute(TestEC.SOME));
    aspsp.getConfig().setImplementerOptions(Collections.emptyMap());
    ioParser = new IOParser(aspsp);
    assertTrue(aio.shouldExecute(StyxExecutionContext.API));
    assertFalse(aio.shouldExecute(StyxExecutionContext.KEEP_ALIVE));
    assertFalse(aio.shouldExecute(TestEC.SOME));
}
Also used : Aspsp(net.petafuel.styx.core.banklookup.sad.entities.Aspsp) Config(net.petafuel.styx.core.banklookup.sad.entities.Config) XS2AFactoryInput(net.petafuel.styx.core.xs2a.factory.XS2AFactoryInput) XS2ARequest(net.petafuel.styx.core.xs2a.contracts.XS2ARequest) XS2AResponse(net.petafuel.styx.core.xs2a.entities.XS2AResponse) ImplementerOption(net.petafuel.styx.core.banklookup.sad.entities.ImplementerOption) Test(org.junit.jupiter.api.Test)

Aggregations

Aspsp (net.petafuel.styx.core.banklookup.sad.entities.Aspsp)8 Config (net.petafuel.styx.core.banklookup.sad.entities.Config)8 ImplementerOption (net.petafuel.styx.core.banklookup.sad.entities.ImplementerOption)8 BeforeAll (org.junit.jupiter.api.BeforeAll)6 AuthenticationResource (net.petafuel.styx.api.v1.authentication.boundary.AuthenticationResource)1 Url (net.petafuel.styx.core.banklookup.sad.entities.Url)1 XS2ARequest (net.petafuel.styx.core.xs2a.contracts.XS2ARequest)1 XS2AResponse (net.petafuel.styx.core.xs2a.entities.XS2AResponse)1 XS2AFactoryInput (net.petafuel.styx.core.xs2a.factory.XS2AFactoryInput)1 ResourceConfig (org.glassfish.jersey.server.ResourceConfig)1 Test (org.junit.jupiter.api.Test)1