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

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


    public TenantResourceTest() {
        super();
    }

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

        String url = "http://localhost:" + PORT + "/tenants/{tenantId}";

        System.out.println(">>> GET: " + url);
        ClientRequest request = new ClientRequest(url);
        request.pathParameter("tenantId", tenant.tenantId().id());
        String output = request.getTarget(String.class);
        System.out.println(output);

        RepresentationReader reader = new RepresentationReader(output);

        assertEquals(tenant.name(), reader.stringValue("name"));
        assertTrue(reader.booleanValue("active"));
    }
View Full Code Here


    @Produces({ OvationsMediaType.ID_OVATION_TYPE })
    @Cache(maxAge=3600)
    public Response getTenant(
            @PathParam("tenantId") String aTenantId) {

        Tenant tenant = this.identityApplicationService().tenant(aTenantId);

        if (tenant == null) {
            throw new WebApplicationException(Response.Status.NOT_FOUND);
        }
View Full Code Here

        // IdentityAccessEventProcessor.register();
    }

    @Transactional
    public void activateTenant(ActivateTenantCommand aCommand) {
        Tenant tenant = this.existingTenant(aCommand.getTenantId());

        tenant.activate();
    }
View Full Code Here

        return userDescriptor;
    }

    @Transactional
    public void deactivateTenant(DeactivateTenantCommand aCommand) {
        Tenant tenant = this.existingTenant(aCommand.getTenantId());

        tenant.deactivate();
    }
View Full Code Here

        return group.isMember(user, this.groupMemberService());
    }

    @Transactional
    public Group provisionGroup(ProvisionGroupCommand aCommand) {
        Tenant tenant = this.existingTenant(aCommand.getTenantId());

        Group group =
                tenant.provisionGroup(
                        aCommand.getGroupName(),
                        aCommand.getDescription());

        this.groupRepository().add(group);
View Full Code Here

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

    @Transactional
    public User registerUser(RegisterUserCommand aCommand) {
        Tenant tenant = this.existingTenant(aCommand.getTenantId());

        User user =
            tenant.registerUser(
                    aCommand.getInvitationIdentifier(),
                    aCommand.getUsername(),
                    aCommand.getPassword(),
                    new Enablement(
                            aCommand.isEnabled(),
View Full Code Here

        group.removeUser(user);
    }

    @Transactional(readOnly=true)
    public Tenant tenant(String aTenantId) {
        Tenant tenant =
                this.tenantRepository()
                    .tenantOfId(new TenantId(aTenantId));

        return tenant;
    }
View Full Code Here

        return group;
    }

    private Tenant existingTenant(String aTenantId) {
        Tenant tenant = this.tenant(aTenantId);

        if (tenant == null) {
            throw new IllegalArgumentException(
                    "Tenant does not exist for: " + aTenantId);
        }
View Full Code Here

    public IdentityApplicationServiceTest() {
        super();
    }

    public void testActivateTenant() throws Exception {
        Tenant tenant = this.tenantAggregate();
        tenant.deactivate();
        assertFalse(tenant.isActive());

        ApplicationServiceRegistry
            .identityApplicationService()
            .activateTenant(new ActivateTenantCommand(tenant.tenantId().id()));

        Tenant changedTenant = DomainRegistry.tenantRepository().tenantOfId(tenant.tenantId());

        assertNotNull(changedTenant);
        assertEquals(tenant.name(), changedTenant.name());
        assertTrue(changedTenant.isActive());
    }
View Full Code Here

        assertNotNull(userDescriptor);
        assertEquals(user.username(), userDescriptor.username());
    }

    public void testDeactivateTenant() throws Exception {
        Tenant tenant = this.tenantAggregate();
        assertTrue(tenant.isActive());

        ApplicationServiceRegistry
            .identityApplicationService()
            .deactivateTenant(new DeactivateTenantCommand(tenant.tenantId().id()));

        Tenant changedTenant = DomainRegistry.tenantRepository().tenantOfId(tenant.tenantId());

        assertNotNull(changedTenant);
        assertEquals(tenant.name(), changedTenant.name());
        assertFalse(changedTenant.isActive());
    }
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.