Package com.atlassian.jira.rest.client.api.domain

Examples of com.atlassian.jira.rest.client.api.domain.SessionCookie


import org.codehaus.jettison.json.JSONObject;

public class SessionCookieJsonParser implements JsonObjectParser<SessionCookie> {
  @Override
  public SessionCookie parse(JSONObject json) throws JSONException {
    return new SessionCookie(json.getString("name"), json.getString("value"));
  }
View Full Code Here


  private final SessionCookieJsonParser sessionCookieJsonParser = new SessionCookieJsonParser();
  private final LoginInfoJsonParser loginInfoJsonParser = new LoginInfoJsonParser();

  @Override
  public Authentication parse(JSONObject json) throws JSONException {
    final SessionCookie sessionCookie = sessionCookieJsonParser.parse(json.getJSONObject("session"));
    final LoginInfo loginInfo = loginInfoJsonParser.parse(json.getJSONObject("loginInfo"));
    return new Authentication(loginInfo, sessionCookie);
  }
View Full Code Here

  public void testParse() throws Exception {
    final AuthenticationJsonParser parser = new AuthenticationJsonParser();
    final Authentication authentication = parser.parse(ResourceUtil
        .getJsonObjectFromResource("/json/authentication/valid.json"));
    Assert.assertEquals(new Authentication(new LoginInfo(54, 23, toDateTime("2010-09-13T17:19:20.752+0300"),
        toDateTime("2010-09-13T17:19:38.220+0900")), new SessionCookie("JSESSIONID", "E5BD072ABEE0082DE4D6C8C2B6D96B79")), authentication);
  }
View Full Code Here

public class SessionCookieJsonParserTest {
  @Test
  public void testParse() throws Exception {
    final SessionCookieJsonParser parser = new SessionCookieJsonParser();
    Assert.assertEquals(new SessionCookie("JSESSIONID", "E5BD072ABEE0082DE4D6C8C2B6D96B79"),
        parser.parse(ResourceUtil.getJsonObjectFromResource("/json/sessionCookie/valid.json")));
  }
View Full Code Here

TOP

Related Classes of com.atlassian.jira.rest.client.api.domain.SessionCookie

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.