From 6c99de1e89d3de90d590cdceea1ce3c5813869fb Mon Sep 17 00:00:00 2001 From: Benjamin Gamard Date: Tue, 20 Mar 2018 23:15:46 +0100 Subject: [PATCH] fix tests --- .../java/com/sismics/docs/rest/util/ClientUtil.java | 12 +++++++++--- .../com/sismics/docs/rest/TestDocumentResource.java | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/docs-web-common/src/test/java/com/sismics/docs/rest/util/ClientUtil.java b/docs-web-common/src/test/java/com/sismics/docs/rest/util/ClientUtil.java index 1f56111b..a45254e2 100644 --- a/docs-web-common/src/test/java/com/sismics/docs/rest/util/ClientUtil.java +++ b/docs-web-common/src/test/java/com/sismics/docs/rest/util/ClientUtil.java @@ -32,13 +32,19 @@ public class ClientUtil { public ClientUtil(WebTarget resource) { this.resource = resource; } - + + public void createUser(String username, String... groupNameList) { + createUser(username, 1000000, groupNameList); // 1MB quota by default + } + /** * Creates a user. * * @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 String adminToken = login("admin", "admin", false); @@ -49,7 +55,7 @@ public class ClientUtil { .param("username", username) .param("email", username + "@docs.com") .param("password", "12345678") - .param("storage_quota", "10000000")), JsonObject.class); // 10MB quota + .param("storage_quota", String.valueOf(quota))), JsonObject.class); // Add to groups for (String groupName : groupNameList) { diff --git a/docs-web/src/test/java/com/sismics/docs/rest/TestDocumentResource.java b/docs-web/src/test/java/com/sismics/docs/rest/TestDocumentResource.java index d7880fb4..5a96673e 100644 --- a/docs-web/src/test/java/com/sismics/docs/rest/TestDocumentResource.java +++ b/docs-web/src/test/java/com/sismics/docs/rest/TestDocumentResource.java @@ -663,7 +663,7 @@ public class TestDocumentResource extends BaseJerseyTest { @Test public void testPptxExtraction() throws Exception { // Login document_pptx - clientUtil.createUser("document_pptx"); + clientUtil.createUser("document_pptx", 10000000); // 10MB quota String documentPptxToken = clientUtil.login("document_pptx"); // Create a document