use of org.springframework.extensions.webscripts.TestWebScriptServer.GetRequest in project alfresco-remote-api by Alfresco.
the class InviteServiceTest method getInvitesByInviteId.
private JSONObject getInvitesByInviteId(String inviteId, int expectedStatus) throws Exception {
// construct get invites URL
String getInvitesUrl = URL_INVITES + "?inviteId=" + inviteId;
// invoke get invites web script
Response response = sendRequest(new GetRequest(getInvitesUrl), expectedStatus);
JSONObject result = new JSONObject(response.getContentAsString());
return result;
}
use of org.springframework.extensions.webscripts.TestWebScriptServer.GetRequest in project alfresco-remote-api by Alfresco.
the class InviteServiceTest method getInvitesByInviteeUserName.
private JSONObject getInvitesByInviteeUserName(String inviteeUserName, int expectedStatus) throws Exception {
// construct get invites URL
String getInvitesUrl = URL_INVITES + "?inviteeUserName=" + inviteeUserName;
// invoke get invites web script
Response response = sendRequest(new GetRequest(getInvitesUrl), expectedStatus);
JSONObject result = new JSONObject(response.getContentAsString());
return result;
}
use of org.springframework.extensions.webscripts.TestWebScriptServer.GetRequest in project alfresco-remote-api by Alfresco.
the class InviteServiceTest method getInviteInfo.
private JSONObject getInviteInfo(String inviteId, String inviteTicket, String inviteeUid) throws Exception {
String url = "/api/invite/" + inviteId + "/" + inviteTicket + "?inviteeUserName=" + inviteeUid;
String runAsUser = AuthenticationUtil.getRunAsUser();
Response response = sendRequest(new GetRequest(url), Status.STATUS_OK);
if (!runAsUser.equals(AuthenticationUtil.getRunAsUser())) {
AuthenticationUtil.setRunAsUser(runAsUser);
}
JSONObject result = new JSONObject(response.getContentAsString());
return result;
}
use of org.springframework.extensions.webscripts.TestWebScriptServer.GetRequest in project alfresco-remote-api by Alfresco.
the class InviteServiceTest method getInvitesByInviterUserName.
private JSONObject getInvitesByInviterUserName(String inviterUserName, int expectedStatus) throws Exception {
// construct get invites URL
String getInvitesUrl = URL_INVITES + "?inviterUserName=" + inviterUserName;
// invoke get invites web script
Response response = sendRequest(new GetRequest(getInvitesUrl), expectedStatus);
JSONObject result = new JSONObject(response.getContentAsString());
return result;
}
use of org.springframework.extensions.webscripts.TestWebScriptServer.GetRequest in project alfresco-remote-api by Alfresco.
the class LinksRestApiTest method getLinks.
// Test helper methods
private JSONObject getLinks(String filter, String username) throws Exception {
String origUser = this.authenticationComponent.getCurrentUserName();
if (username != null) {
this.authenticationComponent.setCurrentUser(username);
filter = "user";
}
String url = URL_LINKS_LIST;
if (filter == null) {
filter = "all";
}
url += "?filter=" + filter;
url += "&startIndex=0&page=1&pageSize=4";
Response response = sendRequest(new GetRequest(url), 200);
JSONObject result = new JSONObject(response.getContentAsString());
if (username != null) {
this.authenticationComponent.setCurrentUser(origUser);
}
return result;
}
Aggregations