Search in sources :

Example 1 with RSEndpointWrapperService

use of com.forgerock.openbanking.aspsp.rs.wrappper.RSEndpointWrapperService in project openbanking-aspsp by OpenBankingToolkit.

the class PaymentsRequestPaymentIdEndpointWrapperTest method setup.

@Before
public void setup() {
    // setting required objects to the perform test
    UUID uuid = UUID.randomUUID();
    RSEndpointWrapperService rsEndpointWrapperService = new RSEndpointWrapperService(obHeaderCheckerService, cryptoApiClient, null, null, rsConfiguration, null, null, false, null, rsConfiguration.financialId, amOpenBankingConfiguration, null, null, null, amResourceServerService, null, null, null, null);
    wrapper = new PaymentsRequestPaymentIdEndpointWrapper(rsEndpointWrapperService, tppStoreService) {

        @Override
        protected ResponseEntity run(PaymentRestEndpointContent main) throws OBErrorException {
            return super.run(main);
        }
    };
    wrapper.xFapiFinancialId(uuid.toString());
    wrapper.principal(new PasswordLessUserNameAuthentication("test-tpp", Collections.EMPTY_LIST));
}
Also used : ResponseEntity(org.springframework.http.ResponseEntity) PasswordLessUserNameAuthentication(com.forgerock.spring.security.multiauth.model.authentication.PasswordLessUserNameAuthentication) RSEndpointWrapperService(com.forgerock.openbanking.aspsp.rs.wrappper.RSEndpointWrapperService) OBErrorException(com.forgerock.openbanking.exceptions.OBErrorException) UUID(java.util.UUID) Before(org.junit.Before)

Example 2 with RSEndpointWrapperService

use of com.forgerock.openbanking.aspsp.rs.wrappper.RSEndpointWrapperService in project openbanking-aspsp by OpenBankingToolkit.

the class PaymentsSubmissionEndpointWrapperTest method setup.

@Before
public void setup() {
    // setting required objects to the perform test
    UUID uuid = UUID.randomUUID();
    // create required object to initialise the wrapper properly
    RSEndpointWrapperService rsEndpointWrapperService = new RSEndpointWrapperService(obHeaderCheckerService, cryptoApiClient, null, null, rsConfiguration, null, null, false, null, rsConfiguration.financialId, amOpenBankingConfiguration, null, null, null, amResourceServerService, null, null, null, null);
    wrapper = new PaymentsSubmissionsEndpointWrapper(rsEndpointWrapperService, tppStoreService) {

        @Override
        protected ResponseEntity run(PaymentRestEndpointContent main) throws OBErrorException {
            return super.run(main);
        }
    };
    wrapper.principal(new PasswordLessUserNameAuthentication("test-tpp", Collections.EMPTY_LIST));
    wrapper.xFapiFinancialId(uuid.toString());
    // generic mock handled stubb
    when(obHeaderCheckerService.verifyFinancialIdHeader(uuid.toString())).thenReturn(true);
}
Also used : ResponseEntity(org.springframework.http.ResponseEntity) PasswordLessUserNameAuthentication(com.forgerock.spring.security.multiauth.model.authentication.PasswordLessUserNameAuthentication) RSEndpointWrapperService(com.forgerock.openbanking.aspsp.rs.wrappper.RSEndpointWrapperService) OBErrorException(com.forgerock.openbanking.exceptions.OBErrorException) UUID(java.util.UUID) Before(org.junit.Before)

Aggregations

RSEndpointWrapperService (com.forgerock.openbanking.aspsp.rs.wrappper.RSEndpointWrapperService)2 OBErrorException (com.forgerock.openbanking.exceptions.OBErrorException)2 PasswordLessUserNameAuthentication (com.forgerock.spring.security.multiauth.model.authentication.PasswordLessUserNameAuthentication)2 UUID (java.util.UUID)2 Before (org.junit.Before)2 ResponseEntity (org.springframework.http.ResponseEntity)2