mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Site Service CRUD API's (Java, JavaScript and REST), unit test methods added to JS API to help unit test JS API's
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8986 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -71,11 +71,27 @@ public abstract class BaseWebScriptTest extends TestCase
|
||||
return sendRequest(METHOD_GET, url, expectedStatus, null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* "DELETE" the url and check for the expected status code
|
||||
*
|
||||
* @param url
|
||||
* @param expectedStatus
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
protected MockHttpServletResponse deleteRequest(String url, int expectedStatus)
|
||||
throws IOException
|
||||
{
|
||||
return sendRequest(METHOD_DELETE, url, expectedStatus, null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* "POST" the url and check for the expected status code
|
||||
*
|
||||
* @param url
|
||||
* @param expectedStatus
|
||||
* @param body
|
||||
* @param contentType
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
@@ -85,6 +101,22 @@ public abstract class BaseWebScriptTest extends TestCase
|
||||
return sendRequest(METHOD_POST, url, expectedStatus, body, contentType);
|
||||
}
|
||||
|
||||
/**
|
||||
* "PUT" the url and check for the expected status code
|
||||
*
|
||||
* @param url
|
||||
* @param expectedStatus
|
||||
* @param body
|
||||
* @param contentType
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
protected MockHttpServletResponse putRequest(String url, int expectedStatus, String body, String contentType)
|
||||
throws IOException
|
||||
{
|
||||
return sendRequest(METHOD_PUT, url, expectedStatus, body, contentType);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param method
|
||||
|
Reference in New Issue
Block a user