public interface CustomerByPasswordTokenGet extends MetaModelGetDsl<Customer,Customer,CustomerByPasswordTokenGet,CustomerExpansionModel<Customer>>
withCustomer(client(), customer -> { final String email = customer.getEmail(); final CustomerToken token = client().executeBlocking(CustomerCreatePasswordTokenCommand.of(email)); final String tokenValue = token.getValue();//this may need to be sent by email to the customer final String newPassword = "newPassword"; final Customer updatedCustomer = client().executeBlocking(CustomerPasswordResetCommand.ofTokenAndPassword(tokenValue, newPassword)); final CustomerSignInResult signInResult = client().executeBlocking(CustomerSignInCommand.of(email, newPassword)); assertThat(signInResult.getCustomer().getId()) .describedAs("customer can sign in with the new password") .isEqualTo(customer.getId()); });
See the test code.
Modifier and Type | Method and Description |
---|---|
List<ExpansionPath<Customer>> |
expansionPaths() |
static CustomerByPasswordTokenGet |
of(CustomerToken token) |
static CustomerByPasswordTokenGet |
of(String token) |
CustomerByPasswordTokenGet |
plusExpansionPaths(ExpansionPath<Customer> expansionPath) |
CustomerByPasswordTokenGet |
withExpansionPaths(ExpansionPath<Customer> expansionPath) |
CustomerByPasswordTokenGet |
withExpansionPaths(List<ExpansionPath<Customer>> expansionPaths) |
deserialize
canDeserialize, httpRequestIntent
plusExpansionPaths, withExpansionPaths
plusExpansionPaths, plusExpansionPaths, withExpansionPaths
static CustomerByPasswordTokenGet of(String token)
static CustomerByPasswordTokenGet of(CustomerToken token)
List<ExpansionPath<Customer>> expansionPaths()
expansionPaths
in interface ExpansionPathContainer<Customer>
expansionPaths
in interface ReferenceExpansionSupport<Customer>
CustomerByPasswordTokenGet plusExpansionPaths(ExpansionPath<Customer> expansionPath)
plusExpansionPaths
in interface ReferenceExpansionDsl<Customer,CustomerByPasswordTokenGet>
CustomerByPasswordTokenGet withExpansionPaths(ExpansionPath<Customer> expansionPath)
withExpansionPaths
in interface ReferenceExpansionDsl<Customer,CustomerByPasswordTokenGet>
CustomerByPasswordTokenGet withExpansionPaths(List<ExpansionPath<Customer>> expansionPaths)
withExpansionPaths
in interface ReferenceExpansionDsl<Customer,CustomerByPasswordTokenGet>