Fixing build
This commit is contained in:
@@ -12,6 +12,7 @@ import org.springframework.util.Assert;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import static demo.account.domain.AccountStatus.ACCOUNT_CONFIRMED;
|
||||
import static demo.account.domain.AccountStatus.ACCOUNT_PENDING;
|
||||
|
||||
/**
|
||||
@@ -24,6 +25,7 @@ public class ConfirmAccount extends Action<Account> {
|
||||
|
||||
public Consumer<Account> getConsumer() {
|
||||
return (account) -> {
|
||||
Assert.isTrue(account.getStatus() != ACCOUNT_CONFIRMED, "The account has already been confirmed");
|
||||
Assert.isTrue(account.getStatus() == ACCOUNT_PENDING, "The account has already been confirmed");
|
||||
|
||||
AccountService accountService = account.getModule(AccountModule.class)
|
||||
|
||||
@@ -25,7 +25,7 @@ public class SuspendAccount extends Action<Account> {
|
||||
|
||||
public Consumer<Account> getConsumer() {
|
||||
return (account) -> {
|
||||
Assert.isTrue(account.getStatus() == ACCOUNT_SUSPENDED, "The account is already suspended");
|
||||
Assert.isTrue(account.getStatus() != ACCOUNT_SUSPENDED, "The account is already suspended");
|
||||
Assert.isTrue(account.getStatus() == ACCOUNT_ACTIVE, "An inactive account cannot be suspended");
|
||||
|
||||
AccountService accountService = account.getModule(AccountModule.class)
|
||||
|
||||
Reference in New Issue
Block a user