Package org.sonatype.nexus.client.core.subsystem.security

Examples of org.sonatype.nexus.client.core.subsystem.security.Roles


  public KenaiIT(final String nexusBundleCoordinates) {
    super(nexusBundleCoordinates);
  }

  protected void createKenaiBaseRoleIfNeeded() {
    final Roles roles = client().getSubsystem(Roles.class);
    try {
      roles.get("kenai-base-role");
    }
    catch (NexusClientNotFoundException e) {
      roles.create("kenai-base-role")
          .withName("Kenai Base Role")
          .withDescription("Kenai Base Role")
          .withRole("nx-admin")
          .save();
    }
View Full Code Here


      throws Exception
  {
    createKenaiBaseRoleIfNeeded();
    // see KenaiAuthcBehaviour: "authenticated" users are those having password = username + "123"
    final NexusClient kenaiAuthenticatedClient = createNexusClient(nexus(), "kenaiuser", "kenaiuser123");
    final Roles kenaiAuthenticatedRoles = kenaiAuthenticatedClient.getSubsystem(Roles.class);
    final Collection<Role> existingRoles = kenaiAuthenticatedRoles.get();
    // most likely redundant, as it all this above would not work, a NexusClientResponseException 401 would be
    // thrown at kenaiAuthenticatedRoles.get();
    assertThat(existingRoles, not(empty()));
  }
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.client.core.subsystem.security.Roles

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.