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

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


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

    public void testQueryTenant() throws Exception {
        Tenant tenant = this.tenantAggregate();

        Tenant queriedTenant =
                ApplicationServiceRegistry
                    .identityApplicationService()
                    .tenant(tenant.tenantId().id());

        assertNotNull(queriedTenant);
View Full Code Here


        if (this.tenant == null) {
            TenantId tenantId =
                DomainRegistry.tenantRepository().nextIdentity();

            this.tenant =
                new Tenant(
                        tenantId,
                        FIXTURE_TENANT_NAME,
                        FIXTURE_TENANT_DESCRIPTION,
                        true);
View Full Code Here

    protected Date tomorrow() {
        return new Date(this.today().getTime() + TWENTY_FOUR_HOURS);
    }

    protected User userAggregate() throws Exception {
        Tenant tenant = this.tenantAggregate();

        RegistrationInvitation registrationInvitation =
            this.registrationInvitationEntity(tenant);

        User user =
            tenant.registerUser(
                    registrationInvitation.invitationId(),
                    FIXTURE_USERNAME,
                    FIXTURE_PASSWORD,
                    new Enablement(true, null, null),
                    this.personEntity(tenant));
View Full Code Here

        return user;
    }

    protected User userAggregate2() throws Exception {
        Tenant tenant = this.tenantAggregate();

        RegistrationInvitation registrationInvitation =
            this.registrationInvitationEntity(tenant);

        User user =
            tenant.registerUser(
                    registrationInvitation.invitationId(),
                    FIXTURE_USERNAME2,
                    FIXTURE_PASSWORD,
                    new Enablement(true, null, null),
                    this.personEntity2(tenant));
View Full Code Here

        return activeTenant;
    }

    protected User userAggregate() {

        Tenant tenant = this.tenantAggregate();

        RegistrationInvitation invitation =
                tenant.offerRegistrationInvitation("open-ended").openEnded();

        User user =
                tenant.registerUser(
                        invitation.invitationId(),
                        "jdoe",
                        FIXTURE_PASSWORD,
                        Enablement.indefiniteEnablement(),
                        new Person(
                                tenant.tenantId(),
                                new FullName("John", "Doe"),
                                new ContactInformation(
                                        new EmailAddress(FIXTURE_USER_EMAIL_ADDRESS),
                                        new PostalAddress(
                                                "123 Pearl Street",
View Full Code Here

        assertTrue(found);
    }

    public void testTenantProvisionedNotification() throws Exception {
        Tenant newTenant =
                ApplicationServiceRegistry
                    .identityApplicationService()
                    .provisionTenant(
                            new ProvisionTenantCommand(
                                    "All-Star Tenant",
                                    "An all-star company.",
                                    "Frank", "Oz",
                                    "frank@allstartcompany.com",
                                    "212-555-1211",
                                    "212-555-1212",
                                    "123 5th Avenue",
                                    "New York",
                                    "NY",
                                    "11201",
                                    "US"));

        assertNotNull(newTenant);

        String url = "http://localhost:" + PORT + "/notifications";

        ClientRequest request = new ClientRequest(url);
        ClientResponse<String> response = request.get(String.class);
        String serializedNotifications = response.getEntity();
        System.out.println(serializedNotifications);

        NotificationLogReader log =
                new NotificationLogReader(serializedNotifications);

        assertFalse(log.isArchived());
        assertNotNull(log.id());

        boolean found = false;

        for (NotificationReader notification : log) {
            String typeName = notification.typeName();

            if (typeName.endsWith("TenantProvisioned")) {
                String tenantId = notification.eventStringValue("tenantId.id");

                assertEquals(newTenant.tenantId().id(), tenantId);

                found = true;
            }
        }
View Full Code Here

        assertTrue(count >= 1);
    }

    private void generateUserEvents() {
        Tenant tenant = this.tenantAggregate();
        Person person = this.userAggregate().person();

        String invitationId =
                tenant.allAvailableRegistrationInvitations()
                       .iterator()
                       .next()
                       .invitationId();

        for (int idx = 0; idx < 25; ++idx) {

            User user =
                ApplicationServiceRegistry
                    .identityApplicationService()
                    .registerUser(
                        new RegisterUserCommand(
                                tenant.tenantId().id(),
                                invitationId,
                                FIXTURE_USERNAME + idx,
                                FIXTURE_PASSWORD,
                                "Zoe",
                                "Doe",
View Full Code Here

TOP

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

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.