Package ru.aristar.jnuget.security

Examples of ru.aristar.jnuget.security.RolePrincipal


    public void testIsUserInRole() throws URISyntaxException {
        //GIVEN
        URI uri = new URI("http", "localhost", "/nuget", null);
        TestNugetContext nugetContext = new TestNugetContext(uri);
        Subject subject = new Subject();
        subject.getPrincipals().add(new RolePrincipal(Role.Administrator));
        nugetContext.setSubject(subject);
        //THEN
        assertThat(nugetContext.isUserInRole(Role.Administrator), is(equalTo(true)));
        assertThat(nugetContext.isUserInRole(Role.Push), is(equalTo(true)));
        assertThat(nugetContext.isUserInRole(Role.GuiUser), is(equalTo(true)));
View Full Code Here

TOP

Related Classes of ru.aristar.jnuget.security.RolePrincipal

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.