add REST-test MEMBERSHIP_UUID_OR_MEMBER_NUMBER_MUST_BE_GIVEN und remove unreachable code
This commit is contained in:
parent
c1cc9c1589
commit
7e3e48a23c
@ -254,10 +254,6 @@ public class HsOfficeCoopAssetsTransactionController implements HsOfficeCoopAsse
|
||||
|
||||
if (resource.getTransactionType() == HsOfficeCoopAssetsTransactionTypeResource.TRANSFER) {
|
||||
final var adoptingMembership = determineAdoptingMembership(resource);
|
||||
if (adoptingMembership == null) {
|
||||
throw new ValidationException(
|
||||
"TRANSFER asset transaction requires adoptingMembership.uuid or adoptingMembership.memberNumber");
|
||||
}
|
||||
final var adoptingAssetTx = createAdoptingAssetTx(entity, adoptingMembership);
|
||||
entity.setAdoptionAssetTx(adoptingAssetTx);
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ class HsOfficeCoopAssetsTransactionControllerRestTest {
|
||||
// set SINGLE_TEST_CASE_EXECUTION to true and make sure you do NOT EVER commit it to git!
|
||||
private static final boolean SINGLE_TEST_CASE_EXECUTION = false;
|
||||
|
||||
private static int DYNAMIC_UUID_START_INDEX = 13;
|
||||
private static final int DYNAMIC_UUID_START_INDEX = 13;
|
||||
|
||||
private static final UUID UNAVAILABLE_MEMBERSHIP_UUID = TestUuidGenerator.use(0);
|
||||
private static final String UNAVAILABLE_MEMBER_NUMBER = "M-1234699";
|
||||
@ -512,6 +512,12 @@ class HsOfficeCoopAssetsTransactionControllerRestTest {
|
||||
.with("adoptingMembership.memberNumber", UNAVAILABLE_MEMBER_NUMBER),
|
||||
"either adoptingMembership.uuid or adoptingMembership.memberNumber can be given, not both"),
|
||||
|
||||
MEMBERSHIP_UUID_OR_MEMBER_NUMBER_MUST_BE_GIVEN(
|
||||
requestBody -> requestBody
|
||||
.with("transactionType", TRANSFER.name())
|
||||
.with("assetValue", "-128.00"),
|
||||
"either adoptingMembership.uuid or adoptingMembership.memberNumber must be given for transactionType=TRANSFER"),
|
||||
|
||||
REVERSAL_ASSET_TRANSACTION_REQUIRES_REVERTED_ASSET_TX_UUID(
|
||||
requestBody -> requestBody
|
||||
.with("transactionType", REVERSAL.name())
|
||||
@ -594,7 +600,7 @@ class HsOfficeCoopAssetsTransactionControllerRestTest {
|
||||
// - set SINGLE_TEST_CASE_EXECUTION to true - see above
|
||||
// - select the test case enum value you want to run
|
||||
assumeThat(!SINGLE_TEST_CASE_EXECUTION ||
|
||||
testCase == BadRequestTestCases.REVERSAL_ASSET_TRANSACTION_REQUIRES_REVERTED_ASSET_TX_UUID).isTrue();
|
||||
testCase == BadRequestTestCases.MEMBERSHIP_UUID_OR_MEMBER_NUMBER_MUST_BE_GIVEN).isTrue();
|
||||
|
||||
// when
|
||||
mockMvc.perform(MockMvcRequestBuilders
|
||||
|
Loading…
Reference in New Issue
Block a user