assertEquals(tenant.name(), changedTenant.name());
assertFalse(changedTenant.isActive());
}
public void testChangeUserContactInformation() throws Exception {
User user = this.userAggregate();
DomainRegistry.userRepository().add(user);
ApplicationServiceRegistry
.identityApplicationService()
.changeUserContactInformation(
new ChangeContactInfoCommand(
user.tenantId().id(),
user.username(),
"mynewemailaddress@saasovation.com",
"777-555-1211",
"777-555-1212",
"123 Pine Street",
"Loveland",
"CO",
"80771",
"US"));
User changedUser =
DomainRegistry
.userRepository()
.userWithUsername(
user.tenantId(),
user.username());
assertNotNull(changedUser);
assertEquals("mynewemailaddress@saasovation.com", changedUser.person().emailAddress().address());
assertEquals("777-555-1211", changedUser.person().contactInformation().primaryTelephone().number());
assertEquals("777-555-1212", changedUser.person().contactInformation().secondaryTelephone().number());
assertEquals("123 Pine Street", changedUser.person().contactInformation().postalAddress().streetAddress());
assertEquals("Loveland", changedUser.person().contactInformation().postalAddress().city());
}