Package org.sonatype.nexus.test.utils

Examples of org.sonatype.nexus.test.utils.UserMessageUtil


  @Test
  public void getUserTestWithOutSource()
      throws IOException
  {

    UserMessageUtil userUtil = new UserMessageUtil(this.getJsonXStream(), MediaType.APPLICATION_JSON);
    PlexusUserResource user = userUtil.getPlexusUser(null, "admin");
    Assert.assertEquals(user.getUserId(), "admin");
    Assert.assertEquals(user.getEmail(), "changeme@yourcompany.com");
    Assert.assertEquals(user.getFirstName(), "Administrator");
    Assert.assertEquals(user.getSource(), "default");
View Full Code Here


  @Test
  public void getUserTestWithAllSource()
      throws IOException
  {

    UserMessageUtil userUtil = new UserMessageUtil(this.getJsonXStream(), MediaType.APPLICATION_JSON);
    PlexusUserResource user = userUtil.getPlexusUser("all", "admin");
    Assert.assertEquals(user.getUserId(), "admin");
    Assert.assertEquals(user.getEmail(), "changeme@yourcompany.com");
    Assert.assertEquals(user.getFirstName(), "Administrator");
    Assert.assertEquals(user.getSource(), "default");
View Full Code Here

  @SuppressWarnings("unchecked")
  @Test
  public void getUsersTest()
      throws IOException
  {
    UserMessageUtil userUtil = new UserMessageUtil(this.getJsonXStream(), MediaType.APPLICATION_JSON);
    List<PlexusUserResource> users = userUtil.getPlexusUsers("default");

    List<String> userIds = new ArrayList<String>();

    for (PlexusUserResource plexusUserResource : users) {
      userIds.add(plexusUserResource.getUserId());
View Full Code Here

  @SuppressWarnings("unchecked")
  @Test
  public void getUsersTestAllSource()
      throws IOException
  {
    UserMessageUtil userUtil = new UserMessageUtil(this.getJsonXStream(), MediaType.APPLICATION_JSON);
    List<PlexusUserResource> users = userUtil.getPlexusUsers("all");

    List<String> userIds = new ArrayList<String>();

    for (PlexusUserResource plexusUserResource : users) {
      userIds.add(plexusUserResource.getUserId());
View Full Code Here

  @Test
  public void junkSourceTest()
      throws IOException
  {

    UserMessageUtil userUtil = new UserMessageUtil(this.getJsonXStream(), MediaType.APPLICATION_JSON);
    List<PlexusUserResource> users = userUtil.getPlexusUsers("VOID");
    Assert.assertEquals(0, users.size());
  }
View Full Code Here

    this.giveUserPrivilege(TEST_USER_NAME, "39");

    TestContainer.getInstance().getTestContext().setUsername(TEST_USER_NAME);
    TestContainer.getInstance().getTestContext().setPassword(TEST_USER_PASSWORD);

    UserMessageUtil userUtil = new UserMessageUtil(this.getJsonXStream(), MediaType.APPLICATION_JSON);
    List<PlexusUserResource> users = userUtil.searchPlexusUsers("default", "admin");

    Assert.assertEquals(1, users.size());
    PlexusUserResource user = users.get(0);
    Assert.assertEquals(user.getUserId(), "admin");
    Assert.assertEquals(user.getEmail(), "changeme@yourcompany.com");
View Full Code Here

    this.giveUserPrivilege(TEST_USER_NAME, "39");

    TestContainer.getInstance().getTestContext().setUsername(TEST_USER_NAME);
    TestContainer.getInstance().getTestContext().setPassword(TEST_USER_PASSWORD);

    UserMessageUtil userUtil = new UserMessageUtil(this.getJsonXStream(), MediaType.APPLICATION_JSON);
    List<PlexusUserResource> users = userUtil.searchPlexusUsers("default", "a");

    List<String> userIds = new ArrayList<String>();

    for (PlexusUserResource plexusUserResource : users) {
      userIds.add(plexusUserResource.getUserId());
View Full Code Here

    this.giveUserPrivilege(TEST_USER_NAME, "39");

    TestContainer.getInstance().getTestContext().setUsername(TEST_USER_NAME);
    TestContainer.getInstance().getTestContext().setPassword(TEST_USER_PASSWORD);

    UserMessageUtil userUtil = new UserMessageUtil(this.getJsonXStream(), MediaType.APPLICATION_JSON);
    List<PlexusUserResource> users = userUtil.searchPlexusUsers("default", "VOID");
    Assert.assertEquals(0, users.size());
  }
View Full Code Here

  @Test
  public void userExactSearchTest()
      throws IOException
  {

    UserMessageUtil userUtil = new UserMessageUtil(this.getJsonXStream(), MediaType.APPLICATION_JSON);
    List<PlexusUserResource> users = userUtil.searchPlexusUsers("default", "admin");

    Assert.assertEquals(1, users.size());
    PlexusUserResource user = users.get(0);
    Assert.assertEquals(user.getUserId(), "admin");
    Assert.assertEquals(user.getEmail(), "changeme@yourcompany.com");
View Full Code Here

  @Test
  public void userSearchTest()
      throws IOException
  {

    UserMessageUtil userUtil = new UserMessageUtil(this.getJsonXStream(), MediaType.APPLICATION_JSON);
    List<PlexusUserResource> users = userUtil.searchPlexusUsers("default", "a");

    List<String> userIds = new ArrayList<String>();

    for (PlexusUserResource plexusUserResource : users) {
      userIds.add(plexusUserResource.getUserId());
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.test.utils.UserMessageUtil

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.