Skip to content

Commit e80b63f

Browse files
Renamed methods to suit TDD demo flow
1 parent 2f7e64d commit e80b63f

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/main/java/com/diffblue/corebanking/compliance/rules/ComplianceRule.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public abstract class ComplianceRule {
1313
*
1414
* @param account
1515
*/
16-
public void setCurrentFailedAccount(Account account) {
16+
public void addToNonCompliantAccounts(Account account) {
1717
if (currentFailedAccounts.contains(account)) {
1818
throw new IllegalStateException();
1919
}
@@ -24,7 +24,7 @@ public void setCurrentFailedAccount(Account account) {
2424
*
2525
* @param account
2626
*/
27-
public void setCurrentPassedAccount(Account account) {
27+
public void addToCompliantAccounts(Account account) {
2828
if (currentPassedAccounts.contains(account)) {
2929
throw new IllegalStateException();
3030
}
@@ -64,7 +64,7 @@ public void purgeAccounts() {
6464
*
6565
* @param account
6666
*/
67-
public void forgetAccount(Account account) {
67+
public void removeFromComplianceLists(Account account) {
6868
this.currentFailedAccounts.remove(account);
6969
this.currentPassedAccounts.remove(account);
7070
}

src/main/java/com/diffblue/corebanking/compliance/rules/ComplianceRuleBalanceAboveOrEqualToZero.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ public class ComplianceRuleBalanceAboveOrEqualToZero extends ComplianceRule {
1212
public void validateAccountCompliance(Account account) {
1313

1414
// Make sure the account does not belong to any list.
15-
this.forgetAccount(account);
15+
this.removeFromComplianceLists(account);
1616

1717
// Check if this account passes or fails this rule.
1818
if (account.getCurrentBalance() >= 0) {
19-
setCurrentPassedAccount(account);
19+
addToCompliantAccounts(account);
2020
} else {
21-
setCurrentFailedAccount(account);
21+
addToNonCompliantAccounts(account);
2222
}
2323
}
2424
}

src/main/java/com/diffblue/corebanking/compliance/rules/ComplianceRuleLargeBalance.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ public class ComplianceRuleLargeBalance extends ComplianceRule {
1818
public void validateAccountCompliance(final Account account) {
1919

2020
// Make sure the account does not belong to any list.
21-
//this.forgetAccount(account);
21+
this.removeFromComplianceLists(account);
2222

2323
if (account == null) {
2424
throw new IllegalArgumentException();
2525
}
2626
if (account.getCurrentBalance()>=MAX_ACCOUNT_VALUE) {
27-
setCurrentFailedAccount(account);
27+
addToNonCompliantAccounts(account);
2828
}
2929
else {
30-
setCurrentPassedAccount(account);
30+
addToCompliantAccounts(account);
3131
}
3232
}
3333
}

0 commit comments

Comments
 (0)