File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed
src/main/java/com/diffblue/corebanking/compliance/rules Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ public abstract class ComplianceRule {
13
13
*
14
14
* @param account
15
15
*/
16
- public void setCurrentFailedAccount (Account account ) {
16
+ public void addToNonCompliantAccounts (Account account ) {
17
17
if (currentFailedAccounts .contains (account )) {
18
18
throw new IllegalStateException ();
19
19
}
@@ -24,7 +24,7 @@ public void setCurrentFailedAccount(Account account) {
24
24
*
25
25
* @param account
26
26
*/
27
- public void setCurrentPassedAccount (Account account ) {
27
+ public void addToCompliantAccounts (Account account ) {
28
28
if (currentPassedAccounts .contains (account )) {
29
29
throw new IllegalStateException ();
30
30
}
@@ -64,7 +64,7 @@ public void purgeAccounts() {
64
64
*
65
65
* @param account
66
66
*/
67
- public void forgetAccount (Account account ) {
67
+ public void removeFromComplianceLists (Account account ) {
68
68
this .currentFailedAccounts .remove (account );
69
69
this .currentPassedAccounts .remove (account );
70
70
}
Original file line number Diff line number Diff line change @@ -12,13 +12,13 @@ public class ComplianceRuleBalanceAboveOrEqualToZero extends ComplianceRule {
12
12
public void validateAccountCompliance (Account account ) {
13
13
14
14
// Make sure the account does not belong to any list.
15
- this .forgetAccount (account );
15
+ this .removeFromComplianceLists (account );
16
16
17
17
// Check if this account passes or fails this rule.
18
18
if (account .getCurrentBalance () >= 0 ) {
19
- setCurrentPassedAccount (account );
19
+ addToCompliantAccounts (account );
20
20
} else {
21
- setCurrentFailedAccount (account );
21
+ addToNonCompliantAccounts (account );
22
22
}
23
23
}
24
24
}
Original file line number Diff line number Diff line change @@ -18,16 +18,16 @@ public class ComplianceRuleLargeBalance extends ComplianceRule {
18
18
public void validateAccountCompliance (final Account account ) {
19
19
20
20
// Make sure the account does not belong to any list.
21
- // this.forgetAccount (account);
21
+ this .removeFromComplianceLists (account );
22
22
23
23
if (account == null ) {
24
24
throw new IllegalArgumentException ();
25
25
}
26
26
if (account .getCurrentBalance ()>=MAX_ACCOUNT_VALUE ) {
27
- setCurrentFailedAccount (account );
27
+ addToNonCompliantAccounts (account );
28
28
}
29
29
else {
30
- setCurrentPassedAccount (account );
30
+ addToCompliantAccounts (account );
31
31
}
32
32
}
33
33
}
You can’t perform that action at this time.
0 commit comments