read migration data path from env var HSADMINNG_MIGRATION_DATA_PATH

This commit is contained in:
Michael Hoennig 2024-07-16 07:17:12 +02:00
parent 94bda1df8a
commit 9e77cefabf

View File

@ -131,6 +131,7 @@ public class ImportOfficeData extends ContextBasedTest {
// at least as the number of lines in business-partners.csv from test-data, but less than real data partner count
public static final int MAX_NUMBER_OF_TEST_DATA_PARTNERS = 100;
public static final String MIGRATION_DATA_PATH = ofNullable(System.getenv("HSADMINNG_MIGRATION_DATA_PATH")).orElse("migration") + "/";
static int relationId = 2000000;
@ -182,7 +183,7 @@ public class ImportOfficeData extends ContextBasedTest {
@Order(1010)
void importBusinessPartners() {
try (Reader reader = resourceReader("migration.data/business-partners.csv")) {
try (Reader reader = resourceReader(MIGRATION_DATA_PATH + "business-partners.csv")) {
final var lines = readAllLines(reader);
importBusinessPartners(justHeader(lines), withoutHeader(lines));
} catch (Exception e) {
@ -228,7 +229,7 @@ public class ImportOfficeData extends ContextBasedTest {
@Order(1020)
void importContacts() {
try (Reader reader = resourceReader("migration.data/contacts.csv")) {
try (Reader reader = resourceReader(MIGRATION_DATA_PATH + "contacts.csv")) {
final var lines = readAllLines(reader);
importContacts(justHeader(lines), withoutHeader(lines));
} catch (Exception e) {
@ -328,7 +329,7 @@ public class ImportOfficeData extends ContextBasedTest {
@Order(1030)
void importSepaMandates() {
try (Reader reader = resourceReader("migration.data/sepa-mandates.csv")) {
try (Reader reader = resourceReader(MIGRATION_DATA_PATH + "sepa-mandates.csv")) {
final var lines = readAllLines(reader);
importSepaMandates(justHeader(lines), withoutHeader(lines));
} catch (Exception e) {
@ -360,7 +361,7 @@ public class ImportOfficeData extends ContextBasedTest {
@Test
@Order(1040)
void importCoopShares() {
try (Reader reader = resourceReader("migration.data/share-transactions.csv")) {
try (Reader reader = resourceReader(MIGRATION_DATA_PATH + "share-transactions.csv")) {
final var lines = readAllLines(reader);
importCoopShares(justHeader(lines), withoutHeader(lines));
} catch (Exception e) {
@ -387,7 +388,7 @@ public class ImportOfficeData extends ContextBasedTest {
@Order(1050)
void importCoopAssets() {
try (Reader reader = resourceReader("migration.data/asset-transactions.csv")) {
try (Reader reader = resourceReader(MIGRATION_DATA_PATH + "asset-transactions.csv")) {
final var lines = readAllLines(reader);
importCoopAssets(justHeader(lines), withoutHeader(lines));
} catch (Exception e) {