public final class CustomerInvalidCurrentPassword extends SphereError
CustomerChangePasswordCommand
is executed with an invalid current password CustomerChangePasswordCommand.currentPassword
.
withCustomer(client(), customer -> {
final String oldPassword = PASSWORD + randomInt();
final String newPassword = "newSecret";
final Throwable throwable = catchThrowable(() -> client().executeBlocking(CustomerChangePasswordCommand.of(customer, oldPassword, newPassword)));
assertThat(throwable).isInstanceOf(ErrorResponseException.class);
final ErrorResponseException errorResponseException = (ErrorResponseException) throwable;
assertThat(errorResponseException.hasErrorCode(CustomerInvalidCurrentPassword.CODE)).isTrue();
});
See the test code.
Modifier and Type | Method and Description |
---|---|
static CustomerInvalidCurrentPassword |
of(String message) |
as, getCode, getMessage, of
public static final String CODE
public static CustomerInvalidCurrentPassword of(String message)