Examples of RestrictedEntity


Examples of org.glassfish.jersey.examples.entityfiltering.security.domain.RestrictedEntity

        return new SecurityEntityFilteringApplication();
    }

    @Test
    public void testRestrictedEntity() throws Exception {
        final RestrictedEntity entity = target("unrestricted-resource").request().get(RestrictedEntity.class);
        final RestrictedSubEntity mixedField = entity.getMixedField();

        // Not null values.
        assertThat(entity.getSimpleField(), notNullValue());
        assertThat(entity.getPermitAll(), notNullValue());
        assertThat(mixedField, notNullValue());
        assertThat(mixedField.getManagerField(), notNullValue());

        // Null values.
        assertThat(entity.getDenyAll(), nullValue());
        assertThat(mixedField.getUserField(), nullValue());
    }
View Full Code Here

Examples of org.glassfish.jersey.examples.entityfiltering.security.domain.RestrictedEntity

                equalTo(Response.Status.FORBIDDEN.getStatusCode()));
    }

    @Test
    public void testPermitAll() throws Exception {
        final RestrictedEntity entity = target("restricted-resource").path("permitAll").request().get(RestrictedEntity.class);
        final RestrictedSubEntity mixedField = entity.getMixedField();

        // Not null values.
        assertThat(entity.getSimpleField(), notNullValue());
        assertThat(entity.getPermitAll(), notNullValue());

        // Null values.
        assertThat(entity.getDenyAll(), nullValue());
        assertThat(mixedField, nullValue());
    }
View Full Code Here

Examples of org.glassfish.jersey.examples.entityfiltering.security.domain.RestrictedEntity

        assertThat(mixedField, nullValue());
    }

    @Test
    public void testRolesAllowed() throws Exception {
        final RestrictedEntity entity = target("restricted-resource").path("rolesAllowed").request().get(RestrictedEntity.class);
        final RestrictedSubEntity mixedField = entity.getMixedField();

        // Not null values.
        assertThat(entity.getSimpleField(), notNullValue());
        assertThat(entity.getPermitAll(), notNullValue());
        assertThat(mixedField, notNullValue());
        assertThat(mixedField.getManagerField(), notNullValue());

        // Null values.
        assertThat(entity.getDenyAll(), nullValue());
        assertThat(mixedField.getUserField(), nullValue());
    }
View Full Code Here

Examples of org.glassfish.jersey.examples.entityfiltering.security.domain.RestrictedEntity

        assertThat(mixedField.getUserField(), nullValue());
    }

    @Test
    public void testRuntimeRolesAllowedUser() throws Exception {
        final RestrictedEntity entity = target("restricted-resource")
                .path("runtimeRolesAllowed")
                .queryParam("roles", "user")
                .request().get(RestrictedEntity.class);
        final RestrictedSubEntity mixedField = entity.getMixedField();

        // Not null values.
        assertThat(entity.getSimpleField(), notNullValue());
        assertThat(entity.getPermitAll(), notNullValue());
        assertThat(mixedField, notNullValue());
        assertThat(mixedField.getUserField(), notNullValue());

        // Null values.
        assertThat(entity.getDenyAll(), nullValue());
        assertThat(mixedField.getManagerField(), nullValue());
    }
View Full Code Here

Examples of org.glassfish.jersey.examples.entityfiltering.security.domain.RestrictedEntity

        assertThat(mixedField.getManagerField(), nullValue());
    }

    @Test
    public void testRuntimeRolesAllowedManagerUser() throws Exception {
        final RestrictedEntity entity = target("restricted-resource")
                .path("runtimeRolesAllowed")
                .queryParam("roles", "user,manager")
                .request().get(RestrictedEntity.class);
        final RestrictedSubEntity mixedField = entity.getMixedField();

        // Not null values.
        assertThat(entity.getSimpleField(), notNullValue());
        assertThat(entity.getPermitAll(), notNullValue());
        assertThat(mixedField, notNullValue());
        assertThat(mixedField.getUserField(), notNullValue());
        assertThat(mixedField.getManagerField(), notNullValue());

        // Null values.
        assertThat(entity.getDenyAll(), nullValue());
    }
View Full Code Here

Examples of org.glassfish.jersey.examples.entityfiltering.security.domain.RestrictedEntity

        assertThat(entity.getDenyAll(), nullValue());
    }

    @Test
    public void testRuntimeRolesAllowedInvalid() throws Exception {
        final RestrictedEntity entity = target("restricted-resource")
                .path("runtimeRolesAllowed")
                .queryParam("roles", "invalid")
                .request().get(RestrictedEntity.class);
        final RestrictedSubEntity mixedField = entity.getMixedField();

        // Not null values.
        assertThat(entity.getSimpleField(), notNullValue());
        assertThat(entity.getPermitAll(), notNullValue());

        // Null values.
        assertThat(entity.getDenyAll(), nullValue());
        assertThat(mixedField, nullValue());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.