From d46e2763b7a857373559584de6f26bfaa6391be9 Mon Sep 17 00:00:00 2001 From: Maxim Grischenko Date: Sun, 19 May 2024 19:52:59 +0200 Subject: [PATCH] change test order --- .../protocol/xs2a/tests/e2e/wiremock/mocks/MockServers.java | 2 ++ .../e2e/wiremock/WiremockConsentE2EXs2aProtocolTest.java | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/opba-protocols/xs2a-protocol-tests/xs2a-bdd-wiremock/src/main/java/de/adorsys/opba/protocol/xs2a/tests/e2e/wiremock/mocks/MockServers.java b/opba-protocols/xs2a-protocol-tests/xs2a-bdd-wiremock/src/main/java/de/adorsys/opba/protocol/xs2a/tests/e2e/wiremock/mocks/MockServers.java index 8ad88d8941..eb4d8a68ce 100644 --- a/opba-protocols/xs2a-protocol-tests/xs2a-bdd-wiremock/src/main/java/de/adorsys/opba/protocol/xs2a/tests/e2e/wiremock/mocks/MockServers.java +++ b/opba-protocols/xs2a-protocol-tests/xs2a-bdd-wiremock/src/main/java/de/adorsys/opba/protocol/xs2a/tests/e2e/wiremock/mocks/MockServers.java @@ -18,6 +18,7 @@ import de.adorsys.opba.protocol.xs2a.service.xs2a.authenticate.embedded.Xs2aAisAuthenticateUserConsentWithPin; import de.adorsys.opba.protocol.xs2a.service.xs2a.consent.CreateAisAccountListConsentService; import de.adorsys.opba.protocol.xs2a.tests.e2e.stages.CommonGivenStages; +import de.adorsys.xs2a.adapter.api.config.AdapterConfig; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.assertj.core.api.Assertions; @@ -361,6 +362,7 @@ public void setSandboxPortInAdapterConfig(int port) { props.store(output, null); } Files.move(tempFile, resourcePath, StandardCopyOption.REPLACE_EXISTING); + AdapterConfig.reload(); } diff --git a/opba-protocols/xs2a-protocol-tests/xs2a-bdd-wiremock/src/test/java/de/adorsys/opba/protocol/xs2a/tests/e2e/wiremock/WiremockConsentE2EXs2aProtocolTest.java b/opba-protocols/xs2a-protocol-tests/xs2a-bdd-wiremock/src/test/java/de/adorsys/opba/protocol/xs2a/tests/e2e/wiremock/WiremockConsentE2EXs2aProtocolTest.java index e61e725444..12f4be934a 100644 --- a/opba-protocols/xs2a-protocol-tests/xs2a-bdd-wiremock/src/test/java/de/adorsys/opba/protocol/xs2a/tests/e2e/wiremock/WiremockConsentE2EXs2aProtocolTest.java +++ b/opba-protocols/xs2a-protocol-tests/xs2a-bdd-wiremock/src/test/java/de/adorsys/opba/protocol/xs2a/tests/e2e/wiremock/WiremockConsentE2EXs2aProtocolTest.java @@ -10,7 +10,10 @@ import de.adorsys.opba.protocol.xs2a.tests.e2e.wiremock.mocks.WiremockAccountInformationRequest; import de.adorsys.opba.protocol.xs2a.tests.e2e.wiremock.mocks.Xs2aProtocolApplication; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestMethodOrder; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; @@ -59,6 +62,7 @@ @Transactional(propagation = Propagation.NOT_SUPPORTED) @SpringBootTest(classes = {Xs2aProtocolApplication.class, JGivenConfig.class}, webEnvironment = RANDOM_PORT) @ActiveProfiles(profiles = {ONE_TIME_POSTGRES_RAMFS, MOCKED_SANDBOX}) +@TestMethodOrder(MethodOrderer.OrderAnnotation.class) class WiremockConsentE2EXs2aProtocolTest extends SpringScenarioTest>, AccountInformationResult> { private static final String OAUTH2_CODE = "2buKRxcMvi79w8xYLFaNsoyh"; @@ -132,6 +136,7 @@ void testIngAccountsListWithConsentUsingRedirect() { } @Test + @Order(1) // test should run before testDeutscheBank, because it's impossible to reinitialize static field URL_TO_CERTIFICATE of DeutscheBankPsuPasswordEncryptionService, which is needed to mock getCertificate call void testPostbankAccountsListWithConsentUsingEmbedded() { given() .embedded_mock_of_postbank_for_max_musterman_accounts_running()