Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add codecov token #1516

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/develop-push-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,26 +62,30 @@ jobs:
OPENSHIFT_TOKEN: ${{ secrets.OPENSHIFT_TOKEN }}

# CODECOV Upload BEGIN
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./last-module-codecoverage/
flags: backend
verbose: true

- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./consent-ui/
flags: frontend
verbose: true

- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./fintech-examples/fintech-last-module-codecoverage/
flags: fintech
verbose: true

- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./fintech-examples/fintech-ui/
flags: fintech
verbose: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import de.adorsys.opba.tppbankingapi.dto.TestResult;
import de.adorsys.opba.tppbankingapi.services.StatisticService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.RandomStringUtils;
import org.jetbrains.annotations.NotNull;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -14,7 +15,6 @@
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.MvcResult;
import org.testcontainers.shaded.org.apache.commons.lang.RandomStringUtils;

import java.time.Instant;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
<include>mockedsandbox/**/*.*</include>
<include>**/*.yml</include>
</includes>
<attachToTest>false</attachToTest>
</configuration>
<executions>
<execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -26,9 +27,15 @@

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.util.Arrays;
import java.util.Properties;
import java.util.UUID;
import java.util.function.Consumer;

Expand Down Expand Up @@ -336,9 +343,27 @@ public SELF embedded_mock_of_postbank_for_max_musterman_accounts_running() {
WireMockConfiguration config = WireMockConfiguration.options().dynamicPort()
.usingFilesUnderClasspath("mockedsandbox/restrecord/embedded/multi-sca/accounts/postbank/");
startWireMock(config, POSTBANK_BANK_ID, it -> it.setUrl("http://localhost:" + sandbox.port() + "/{Service Group}/DE/Postbank"));
setSandboxPortInAdapterConfig(sandbox.port());
return self();
}

@SneakyThrows
public void setSandboxPortInAdapterConfig(int port) {
Path resourcePath = Paths.get(MockServers.class.getClassLoader().getResource("adapter.config.properties").toURI());
log.info(resourcePath.toString());
Properties props = new Properties();
try (InputStream input = Files.newInputStream(resourcePath)) {
props.load(input);
}
props.setProperty("deutsche-bank.aspsp.certificate.url", "http://localhost:" + port + "/pb/aspsp-certificates/tpp-pb-password_cert.pem");

Path tempFile = Files.createTempFile("temp", ".properties");
try (OutputStream output = Files.newOutputStream(tempFile)) {
props.store(output, null);
}
Files.move(tempFile, resourcePath, StandardCopyOption.REPLACE_EXISTING);
AdapterConfig.reload();
}


public SELF decoupled_embedded_approach_sca_decoupled_start_mock_of_sandbox_for_max_musterman_accounts_running() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"scenarioName": "AccountsListUsingPostbankEmbedded",
"newScenarioState": "GetCertificatePem",
"request" : {
"urlPattern" : "/pb/aspsp-certificates/tpp-pb-password_cert.pem",
"method" : "GET",
"headers" : {
}
},
"response" : {
"status" : 200,
"body" : "-----BEGIN CERTIFICATE-----\nMIICMzCCAZygAwIBAgIJALiPnVsvq8dsMA0GCSqGSIb3DQEBBQUAMFMxCzAJBgNV BAYTAlVTMQwwCgYDVQQIEwNmb28xDDAKBgNVBAcTA2ZvbzEMMAoGA1UEChMDZm9v MQwwCgYDVQQLEwNmb28xDDAKBgNVBAMTA2ZvbzAeFw0xMzAzMTkxNTQwMTlaFw0x ODAzMTgxNTQwMTlaMFMxCzAJBgNVBAYTAlVTMQwwCgYDVQQIEwNmb28xDDAKBgNV BAcTA2ZvbzEMMAoGA1UEChMDZm9vMQwwCgYDVQQLEwNmb28xDDAKBgNVBAMTA2Zv bzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAzdGfxi9CNbMf1UUcvDQh7MYB OveIHyc0E0KIbhjK5FkCBU4CiZrbfHagaW7ZEcN0tt3EvpbOMxxc/ZQU2WN/s/wP xph0pSfsfFsTKM4RhTWD2v4fgk+xZiKd1p0+L4hTtpwnEw0uXRVd0ki6muwV5y/P +5FHUeldq+pgTcgzuK8CAwEAAaMPMA0wCwYDVR0PBAQDAgLkMA0GCSqGSIb3DQEB BQUAA4GBAJiDAAtY0mQQeuxWdzLRzXmjvdSuL9GoyT3BF/jSnpxz5/58dba8pWen v3pj4P3w5DoOso0rzkZy2jEsEitlVM2mLSbQpMM+MUVQCQoiG6W9xuCFuxSrwPIS pAqEAuV4DNoxQKKWmhVv+J0ptMWD25Pnpxeq5sXzghfJnslJlQND\n-----END CERTIFICATE-----",
"headers" : {
"Content-Type" : "application/octet-stream"
}
},
"uuid" : "96f5dbd8-0def-4ca0-9aa5-3ee061adc195",
"persistent" : true
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<MockServers, WiremockAccountInformationRequest<? extends WiremockAccountInformationRequest<?>>, AccountInformationResult> {

private static final String OAUTH2_CODE = "2buKRxcMvi79w8xYLFaNsoyh";
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
<assertj.version>3.12.2</assertj.version>
<jgiven.version>1.1.0</jgiven.version>
<wiremock.version>2.25.1</wiremock.version>
<testcontainers.version>1.16.3</testcontainers.version>
<testcontainers.version>1.19.8</testcontainers.version>
<testcontainers-jna.version>5.10.0</testcontainers-jna.version>
<zerocode.tdd.version>1.3.17</zerocode.tdd.version>
<selenium-jupiter.version>3.4.0</selenium-jupiter.version>
Expand Down
Loading