Package com.saasovation.identityaccess.domain.model.identity

Examples of com.saasovation.identityaccess.domain.model.identity.User


        Group group =
                this.existingGroup(
                        aCommand.getTenantId(),
                        aCommand.getGroupName());

        User user =
                this.existingUser(
                        aCommand.getTenantId(),
                        aCommand.getUsername());

        group.addUser(user);
View Full Code Here


        tenant.deactivate();
    }

    @Transactional
    public void changeUserContactInformation(ChangeContactInfoCommand aCommand) {
        User user = this.existingUser(aCommand.getTenantId(), aCommand.getUsername());

        this.internalChangeUserContactInformation(
                user,
                new ContactInformation(
                        new EmailAddress(aCommand.getEmailAddress()),
View Full Code Here

                        new Telephone(aCommand.getSecondaryTelephone())));
    }

    @Transactional
    public void changeUserEmailAddress(ChangeEmailAddressCommand aCommand) {
        User user = this.existingUser(aCommand.getTenantId(), aCommand.getUsername());

        this.internalChangeUserContactInformation(
                user,
                user.person()
                    .contactInformation()
                    .changeEmailAddress(new EmailAddress(aCommand.getEmailAddress())));
    }
View Full Code Here

                    .changeEmailAddress(new EmailAddress(aCommand.getEmailAddress())));
    }

    @Transactional
    public void changeUserPostalAddress(ChangePostalAddressCommand aCommand) {
        User user = this.existingUser(aCommand.getTenantId(), aCommand.getUsername());

        this.internalChangeUserContactInformation(
                user,
                user.person()
                    .contactInformation()
                    .changePostalAddress(
                            new PostalAddress(
                                    aCommand.getAddressStreetAddress(),
                                    aCommand.getAddressCity(),
View Full Code Here

                                    aCommand.getAddressCountryCode())));
    }

    @Transactional
    public void changeUserPrimaryTelephone(ChangePrimaryTelephoneCommand aCommand) {
        User user = this.existingUser(aCommand.getTenantId(), aCommand.getUsername());

        this.internalChangeUserContactInformation(
                user,
                user.person()
                    .contactInformation()
                    .changePrimaryTelephone(new Telephone(aCommand.getTelephone())));
    }
View Full Code Here

        DomainRegistry.groupRepository().add(parentGroup);

        Group childGroup = this.group2Aggregate();
        DomainRegistry.groupRepository().add(childGroup);

        User user = this.userAggregate();
        DomainRegistry.userRepository().add(user);

        assertEquals(0, parentGroup.groupMembers().size());
        assertEquals(0, childGroup.groupMembers().size());

        parentGroup.addGroup(childGroup, DomainRegistry.groupMemberService());

        ApplicationServiceRegistry
            .identityApplicationService()
            .addUserToGroup(new AddUserToGroupCommand(
                childGroup.tenantId().id(),
                childGroup.name(),
                user.username()));

        assertEquals(1, parentGroup.groupMembers().size());
        assertEquals(1, childGroup.groupMembers().size());
        assertTrue(parentGroup.isMember(user, DomainRegistry.groupMemberService()));
        assertTrue(childGroup.isMember(user, DomainRegistry.groupMemberService()));
View Full Code Here

        assertTrue(parentGroup.isMember(user, DomainRegistry.groupMemberService()));
        assertTrue(childGroup.isMember(user, DomainRegistry.groupMemberService()));
    }

    public void testAuthenticateUser() throws Exception {
        User user = this.userAggregate();
        DomainRegistry.userRepository().add(user);

        UserDescriptor userDescriptor =
                ApplicationServiceRegistry
                    .identityApplicationService()
                    .authenticateUser(new AuthenticateUserCommand(
                            user.tenantId().id(),
                            user.username(),
                            FIXTURE_PASSWORD));

        assertNotNull(userDescriptor);
        assertEquals(user.username(), userDescriptor.username());
    }
View Full Code Here

        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());
    }
View Full Code Here

        assertEquals("123 Pine Street", changedUser.person().contactInformation().postalAddress().streetAddress());
        assertEquals("Loveland", changedUser.person().contactInformation().postalAddress().city());
    }

    public void testChangeUserEmailAddress() throws Exception {
        User user = this.userAggregate();
        DomainRegistry.userRepository().add(user);

        ApplicationServiceRegistry
            .identityApplicationService()
            .changeUserEmailAddress(
                    new ChangeEmailAddressCommand(
                            user.tenantId().id(),
                            user.username(),
                            "mynewemailaddress@saasovation.com"));

        User changedUser =
                DomainRegistry
                    .userRepository()
                    .userWithUsername(
                            user.tenantId(),
                            user.username());

        assertNotNull(changedUser);
        assertEquals("mynewemailaddress@saasovation.com", changedUser.person().emailAddress().address());
    }
View Full Code Here

        assertNotNull(changedUser);
        assertEquals("mynewemailaddress@saasovation.com", changedUser.person().emailAddress().address());
    }

    public void testChangeUserPostalAddress() throws Exception {
        User user = this.userAggregate();
        DomainRegistry.userRepository().add(user);

        ApplicationServiceRegistry
            .identityApplicationService()
            .changeUserPostalAddress(
                    new ChangePostalAddressCommand(
                            user.tenantId().id(),
                            user.username(),
                            "123 Pine Street",
                            "Loveland",
                            "CO",
                            "80771",
                            "US"));

        User changedUser =
                DomainRegistry
                    .userRepository()
                    .userWithUsername(
                            user.tenantId(),
                            user.username());

        assertNotNull(changedUser);
        assertEquals("123 Pine Street", changedUser.person().contactInformation().postalAddress().streetAddress());
        assertEquals("Loveland", changedUser.person().contactInformation().postalAddress().city());
    }
View Full Code Here

TOP

Related Classes of com.saasovation.identityaccess.domain.model.identity.User

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.