From 57643f5b5b623267546b80cdf8a3d79aee855f06 Mon Sep 17 00:00:00 2001 From: MK13 Date: Sat, 16 Mar 2019 22:27:02 +0100 Subject: [PATCH] Various stuff build-war maven profile now builds a tomcat parallel deployment compatible war file. Fix test data and integrations tests. Add a bunch of accounts to the init data. --- pom.xml | 5 +- .../database/common/V1_0_1__initData.sql | 53 ++++++++++++++++++- ...countController_getAllIntegrationTest.java | 2 +- .../integration/V999_99_00__testdata.sql | 4 +- 4 files changed, 59 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index e38c2cd..0f05163 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ de.77zzcx7 financer - 1.0-SNAPSHOT + 1-SNAPSHOT ${packaging.type} financer @@ -160,6 +160,9 @@ war + + financer##${project.version} + org.springframework.boot diff --git a/src/main/resources/database/common/V1_0_1__initData.sql b/src/main/resources/database/common/V1_0_1__initData.sql index 084e8fc..e675048 100644 --- a/src/main/resources/database/common/V1_0_1__initData.sql +++ b/src/main/resources/database/common/V1_0_1__initData.sql @@ -12,4 +12,55 @@ INSERT INTO account ("key", type, status, current_balance) VALUES ('accounts.start', 'START', 'OPEN', 0); INSERT INTO account ("key", type, status, current_balance) -VALUES ('accounts.rent', 'EXPENSE', 'OPEN', 0); \ No newline at end of file +VALUES ('accounts.rent', 'EXPENSE', 'OPEN', 0); + +INSERT INTO account ("key", type, status, current_balance) +VALUES ('accounts.fvs', 'EXPENSE', 'OPEN', 0); + +INSERT INTO account ("key", type, status, current_balance) +VALUES ('accounts.car', 'EXPENSE', 'OPEN', 0); + +INSERT INTO account ("key", type, status, current_balance) +VALUES ('accounts.gas', 'EXPENSE', 'OPEN', 0); + +INSERT INTO account ("key", type, status, current_balance) +VALUES ('accounts.alimony', 'EXPENSE', 'OPEN', 0); + +INSERT INTO account ("key", type, status, current_balance) +VALUES ('accounts.electricitywater', 'EXPENSE', 'OPEN', 0); + +INSERT INTO account ("key", type, status, current_balance) +VALUES ('accounts.mobile', 'EXPENSE', 'OPEN', 0); + +INSERT INTO account ("key", type, status, current_balance) +VALUES ('accounts.internet', 'EXPENSE', 'OPEN', 0); + +INSERT INTO account ("key", type, status, current_balance) +VALUES ('accounts.legalinsurance', 'EXPENSE', 'OPEN', 0); + +INSERT INTO account ("key", type, status, current_balance) +VALUES ('accounts.netflix', 'EXPENSE', 'OPEN', 0); + +INSERT INTO account ("key", type, status, current_balance) +VALUES ('accounts.hetzner', 'EXPENSE', 'OPEN', 0); + +INSERT INTO account ("key", type, status, current_balance) +VALUES ('accounts.fees', 'EXPENSE', 'OPEN', 0); + +INSERT INTO account ("key", type, status, current_balance) +VALUES ('accounts.food', 'EXPENSE', 'OPEN', 0); + +INSERT INTO account ("key", type, status, current_balance) +VALUES ('accounts.foodexternal', 'EXPENSE', 'OPEN', 0); + +INSERT INTO account ("key", type, status, current_balance) +VALUES ('accounts.child', 'EXPENSE', 'OPEN', 0); + +INSERT INTO account ("key", type, status, current_balance) +VALUES ('accounts.creditcard', 'LIABILITY', 'OPEN', 0); + +INSERT INTO account ("key", type, status, current_balance) +VALUES ('accounts.studentloan', 'LIABILITY', 'OPEN', 0); + +INSERT INTO account ("key", type, status, current_balance) +VALUES ('accounts.bed', 'LIABILITY', 'OPEN', 0); \ No newline at end of file diff --git a/src/test/java/de/financer/controller/integration/AccountController_getAllIntegrationTest.java b/src/test/java/de/financer/controller/integration/AccountController_getAllIntegrationTest.java index cc1390c..082d37f 100644 --- a/src/test/java/de/financer/controller/integration/AccountController_getAllIntegrationTest.java +++ b/src/test/java/de/financer/controller/integration/AccountController_getAllIntegrationTest.java @@ -44,6 +44,6 @@ public class AccountController_getAllIntegrationTest { final List allAccounts = this.objectMapper .readValue(mvcResult.getResponse().getContentAsByteArray(), new TypeReference>() {}); - Assert.assertEquals(6, allAccounts.size()); + Assert.assertEquals(23, allAccounts.size()); } } diff --git a/src/test/resources/database/hsqldb/integration/V999_99_00__testdata.sql b/src/test/resources/database/hsqldb/integration/V999_99_00__testdata.sql index 18c37f1..797e1a2 100644 --- a/src/test/resources/database/hsqldb/integration/V999_99_00__testdata.sql +++ b/src/test/resources/database/hsqldb/integration/V999_99_00__testdata.sql @@ -4,7 +4,7 @@ VALUES ('accounts.convenience', 'EXPENSE', 'OPEN', 0); --Recurring transactions INSERT INTO recurring_transaction (from_account_id, to_account_id, description, amount, interval_type, first_occurrence, holiday_weekend_type) -VALUES (2, 1, 'Pay', 250000, 'MONTHLY', '2019-01-15', 'NEXT_WORKDAY'); +VALUES ((SELECT ID FROM account WHERE "key" = 'accounts.income'), (SELECT ID FROM account WHERE "key" = 'accounts.checkaccount'), 'Pay', 250000, 'MONTHLY', '2019-01-15', 'NEXT_WORKDAY'); INSERT INTO recurring_transaction (from_account_id, to_account_id, description, amount, interval_type, first_occurrence, holiday_weekend_type) -VALUES (3, 5, 'Pretzel', 170, 'DAILY', '2019-02-20', 'SAME_DAY'); \ No newline at end of file +VALUES ((SELECT ID FROM account WHERE "key" = 'accounts.cash'), (SELECT ID FROM account WHERE "key" = 'accounts.convenience'), 'Pretzel', 170, 'DAILY', '2019-02-20', 'SAME_DAY'); \ No newline at end of file