Package com.atlassian.jira.rest.client.internal.jersey

Examples of com.atlassian.jira.rest.client.internal.jersey.JerseyJiraRestClient


  protected void setAdmin() {
    setClient(ADMIN_USERNAME, ADMIN_PASSWORD);
  }

  protected void setClient(String username, String password) {
    client = new JerseyJiraRestClient(jiraUri, new BasicHttpAuthenticationHandler(username, password));
  }
View Full Code Here


  protected void setClient(String username, String password) {
    client = new JerseyJiraRestClient(jiraUri, new BasicHttpAuthenticationHandler(username, password));
  }

  protected void setAnonymousMode() {
    client = new JerseyJiraRestClient(jiraUri, new AnonymousAuthenticationHandler());
  }
View Full Code Here

  }

  @Test
  public void testInvalidCredentials() {
    client = new JerseyJiraRestClient(jiraUri, new BasicHttpAuthenticationHandler(ADMIN_USERNAME, ADMIN_PASSWORD + "invalid"));
    TestUtil.assertErrorCode(401, new Runnable() {
      @Override
      public void run() {
        client.getSessionClient().getCurrentSession(new NullProgressMonitor());
      }
View Full Code Here

  public void testGetCurrentSession() throws Exception {
    final Session session = client.getSessionClient().getCurrentSession(new NullProgressMonitor());
    assertEquals(ADMIN_USERNAME, session.getUsername());

    // that is not a mistake - username and the password for this user is the same
    client = new JerseyJiraRestClient(jiraUri, new BasicHttpAuthenticationHandler(TestConstants.USER1.getName(),
        TestConstants.USER1.getName()));
    final Session session2 = client.getSessionClient().getCurrentSession(new NullProgressMonitor());
    assertEquals(TestConstants.USER1.getName(), session2.getUsername());
    final DateTime lastFailedLoginDate = session2.getLoginInfo().getLastFailedLoginDate();

    final JerseyJiraRestClient client2 = new JerseyJiraRestClient(jiraUri, new BasicHttpAuthenticationHandler(TestConstants.USER1.getName(),
        "bad-password"));
    final DateTime now = new DateTime();
    TestUtil.assertErrorCode(401, new Runnable() {
      @Override
      public void run() {
        client2.getSessionClient().getCurrentSession(new NullProgressMonitor());
      }
    });
    while (!new DateTime().isAfter(lastFailedLoginDate)) {
      Thread.sleep(20);
    }
View Full Code Here

  protected void setAdmin() {
    setClient(ADMIN_USERNAME, ADMIN_PASSWORD);
  }

  protected void setClient(String username, String password) {
    client = new JerseyJiraRestClient(jiraUri, new BasicHttpAuthenticationHandler(username, password));
  }
View Full Code Here

  protected void setClient(String username, String password) {
    client = new JerseyJiraRestClient(jiraUri, new BasicHttpAuthenticationHandler(username, password));
  }

  protected void setAnonymousMode() {
    client = new JerseyJiraRestClient(jiraUri, new AnonymousAuthenticationHandler());
  }
View Full Code Here

TOP

Related Classes of com.atlassian.jira.rest.client.internal.jersey.JerseyJiraRestClient

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.