mirror of
https://github.com/sismics/docs.git
synced 2024-11-04 22:23:23 +01:00
fix tests
This commit is contained in:
parent
3613f6f8de
commit
6c99de1e89
@ -33,12 +33,18 @@ public class ClientUtil {
|
|||||||
this.resource = resource;
|
this.resource = resource;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void createUser(String username, String... groupNameList) {
|
||||||
|
createUser(username, 1000000, groupNameList); // 1MB quota by default
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a user.
|
* Creates a user.
|
||||||
*
|
*
|
||||||
* @param username Username
|
* @param username Username
|
||||||
|
* @param quota Quota
|
||||||
|
* @param groupNameList Group names
|
||||||
*/
|
*/
|
||||||
public void createUser(String username, String... groupNameList) {
|
public void createUser(String username, int quota, String... groupNameList) {
|
||||||
// Login admin to create the user
|
// Login admin to create the user
|
||||||
String adminToken = login("admin", "admin", false);
|
String adminToken = login("admin", "admin", false);
|
||||||
|
|
||||||
@ -49,7 +55,7 @@ public class ClientUtil {
|
|||||||
.param("username", username)
|
.param("username", username)
|
||||||
.param("email", username + "@docs.com")
|
.param("email", username + "@docs.com")
|
||||||
.param("password", "12345678")
|
.param("password", "12345678")
|
||||||
.param("storage_quota", "10000000")), JsonObject.class); // 10MB quota
|
.param("storage_quota", String.valueOf(quota))), JsonObject.class);
|
||||||
|
|
||||||
// Add to groups
|
// Add to groups
|
||||||
for (String groupName : groupNameList) {
|
for (String groupName : groupNameList) {
|
||||||
|
@ -663,7 +663,7 @@ public class TestDocumentResource extends BaseJerseyTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testPptxExtraction() throws Exception {
|
public void testPptxExtraction() throws Exception {
|
||||||
// Login document_pptx
|
// Login document_pptx
|
||||||
clientUtil.createUser("document_pptx");
|
clientUtil.createUser("document_pptx", 10000000); // 10MB quota
|
||||||
String documentPptxToken = clientUtil.login("document_pptx");
|
String documentPptxToken = clientUtil.login("document_pptx");
|
||||||
|
|
||||||
// Create a document
|
// Create a document
|
||||||
|
Loading…
Reference in New Issue
Block a user