Skip to content

Commit 059f335

Browse files
committed
chore: rename PaymentCounter methods for clarity
1 parent 9c391a0 commit 059f335

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main/java/com/acme/statistics/PaymentCounter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ public class PaymentCounter {
3131
PaymentCounter() {
3232
}
3333

34-
public void failedPayments() {
34+
public void paymentFailed() {
3535
this.failedPayments++;
3636
}
3737

38-
public void successfulPayments() {
38+
public void paymentSucceeded() {
3939
this.successfulPayments++;
4040
}
4141
}

src/main/java/com/acme/statistics/PaymentCounterService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void success(@Observes PaymentSuccessEvent event) {
3838
Payment payment = event.payment();
3939
Product product = payment.getProduct();
4040
PaymentCounter counter = repository.findById(payment.getProduct().code()).orElseGet(() -> new PaymentCounter(product));
41-
counter.successfulPayments();
41+
counter.paymentSucceeded();
4242
repository.save(counter);
4343
}
4444

@@ -48,7 +48,7 @@ void success(@Observes PaymentErrorEvent event) {
4848
Payment payment = event.payment();
4949
Product product = payment.getProduct();
5050
PaymentCounter counter = repository.findById(payment.getProduct().code()).orElseGet(() -> new PaymentCounter(product));
51-
counter.failedPayments();
51+
counter.paymentFailed();
5252
repository.save(counter);
5353
}
5454

0 commit comments

Comments
 (0)