more scenario tests for coop-assets

This commit is contained in:
Michael Hoennig 2024-12-06 10:16:49 +01:00
parent 6464d6f1ec
commit ee3b96ec03
5 changed files with 95 additions and 0 deletions

View File

@ -13,6 +13,7 @@ components:
- ADOPTION - ADOPTION
- CLEARING - CLEARING
- LOSS - LOSS
- LIMITATION
HsOfficeCoopAssetsTransaction: HsOfficeCoopAssetsTransaction:
type: object type: object

View File

@ -14,8 +14,11 @@ import net.hostsharing.hsadminng.hs.office.scenarios.debitor.FinallyDeleteSepaMa
import net.hostsharing.hsadminng.hs.office.scenarios.debitor.InvalidateSepaMandateForDebitor; import net.hostsharing.hsadminng.hs.office.scenarios.debitor.InvalidateSepaMandateForDebitor;
import net.hostsharing.hsadminng.hs.office.scenarios.membership.CancelMembership; import net.hostsharing.hsadminng.hs.office.scenarios.membership.CancelMembership;
import net.hostsharing.hsadminng.hs.office.scenarios.membership.CreateMembership; import net.hostsharing.hsadminng.hs.office.scenarios.membership.CreateMembership;
import net.hostsharing.hsadminng.hs.office.scenarios.membership.coopassets.CreateCoopAssetsClearingTransaction;
import net.hostsharing.hsadminng.hs.office.scenarios.membership.coopassets.CreateCoopAssetsDepositTransaction; import net.hostsharing.hsadminng.hs.office.scenarios.membership.coopassets.CreateCoopAssetsDepositTransaction;
import net.hostsharing.hsadminng.hs.office.scenarios.membership.coopassets.CreateCoopAssetsDisbursalTransaction; import net.hostsharing.hsadminng.hs.office.scenarios.membership.coopassets.CreateCoopAssetsDisbursalTransaction;
import net.hostsharing.hsadminng.hs.office.scenarios.membership.coopassets.CreateCoopAssetsLimitationTransaction;
import net.hostsharing.hsadminng.hs.office.scenarios.membership.coopassets.CreateCoopAssetsLossTransaction;
import net.hostsharing.hsadminng.hs.office.scenarios.membership.coopassets.CreateCoopAssetsRevertSimpleTransaction; import net.hostsharing.hsadminng.hs.office.scenarios.membership.coopassets.CreateCoopAssetsRevertSimpleTransaction;
import net.hostsharing.hsadminng.hs.office.scenarios.membership.coopassets.CreateCoopAssetsRevertTransferTransaction; import net.hostsharing.hsadminng.hs.office.scenarios.membership.coopassets.CreateCoopAssetsRevertTransferTransaction;
import net.hostsharing.hsadminng.hs.office.scenarios.membership.coopassets.CreateCoopAssetsTransferTransaction; import net.hostsharing.hsadminng.hs.office.scenarios.membership.coopassets.CreateCoopAssetsTransferTransaction;
@ -510,6 +513,45 @@ class HsOfficeScenarioTests extends ScenarioTest {
.given("dateOfIncorrectTransaction", "2024-02-15") .given("dateOfIncorrectTransaction", "2024-02-15")
.doRun(); .doRun();
} }
@Test
@Order(4306)
@Requires("Coop-Assets: M-3101000 - Test AG - DEPOSIT Transaction")
void shouldSettleMembersDebtWithCoopAssetsViaClearing() {
new CreateCoopAssetsClearingTransaction(scenarioTest)
.given("memberNumber", "M-3101000")
.given("reference", "cancel 2024-01-15")
.given("valueToClear", 2 * 64)
.given("comment", "clearing according to members debt")
.given("transactionDate", "2024-02-15")
.doRun();
}
@Test
@Order(4307)
@Requires("Coop-Assets: M-3101000 - Test AG - DEPOSIT Transaction")
void shouldAssignmentBalanceSheetLossInCaseOfCancellationOfShares() {
new CreateCoopAssetsLossTransaction(scenarioTest)
.given("memberNumber", "M-3101000")
.given("reference", "cancel 2024-01-15")
.given("valueLost", 2 * 64)
.given("comment", "assign balance sheet loss")
.given("transactionDate", "2024-02-15")
.doRun();
}
@Test
@Order(4307)
@Requires("Coop-Assets: M-3101000 - Test AG - DEPOSIT Transaction")
void shouldAdjustCoopAssetsAfterLimitationPeriod() {
new CreateCoopAssetsLimitationTransaction(scenarioTest)
.given("memberNumber", "M-3101000")
.given("reference", "cancel 2024-01-15")
.given("valueForLimitation", 2 * 64)
.given("comment", "adjust coop ")
.given("transactionDate", "2024-02-15")
.doRun();
}
} }
@Nested @Nested

View File

@ -0,0 +1,17 @@
package net.hostsharing.hsadminng.hs.office.scenarios.membership.coopassets;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
public class CreateCoopAssetsClearingTransaction extends CreateCoopAssetsTransaction {
public CreateCoopAssetsClearingTransaction(final ScenarioTest testSuite) {
super(testSuite);
}
@Override
protected HttpResponse run() {
given("transactionType", "CLEARING");
given("assetValue", "-%{valueToClear}");
return super.run();
}
}

View File

@ -0,0 +1,17 @@
package net.hostsharing.hsadminng.hs.office.scenarios.membership.coopassets;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
public class CreateCoopAssetsLimitationTransaction extends CreateCoopAssetsTransaction {
public CreateCoopAssetsLimitationTransaction(final ScenarioTest testSuite) {
super(testSuite);
}
@Override
protected HttpResponse run() {
given("transactionType", "LIMITATION");
given("assetValue", "-%{valueForLimitation}");
return super.run();
}
}

View File

@ -0,0 +1,18 @@
package net.hostsharing.hsadminng.hs.office.scenarios.membership.coopassets;
import net.hostsharing.hsadminng.hs.scenarios.ScenarioTest;
public class CreateCoopAssetsLossTransaction extends CreateCoopAssetsTransaction {
public CreateCoopAssetsLossTransaction(final ScenarioTest testSuite) {
super(testSuite);
introduction("Usually, a loss transaction goes along with a disbursal transaction.");
}
@Override
protected HttpResponse run() {
given("transactionType", "LOSS");
given("assetValue", "-%{valueLost}");
return super.run();
}
}