From 17e2d244f08d3c9c2143d67098350f9faa2d7f14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pfeuffer?= Date: Wed, 14 Nov 2018 10:44:58 +0100 Subject: [PATCH] Fix invalid objects in test The test does not test the functionality of the user name validation otherwise but of a melange of all the other validations --- .../java/sonia/scm/api/v2/resources/UserRootResourceTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scm-webapp/src/test/java/sonia/scm/api/v2/resources/UserRootResourceTest.java b/scm-webapp/src/test/java/sonia/scm/api/v2/resources/UserRootResourceTest.java index 077381cc37..284e7d1d7b 100644 --- a/scm-webapp/src/test/java/sonia/scm/api/v2/resources/UserRootResourceTest.java +++ b/scm-webapp/src/test/java/sonia/scm/api/v2/resources/UserRootResourceTest.java @@ -103,7 +103,7 @@ public class UserRootResourceTest { @Test public void shouldGet400OnCreatingNewUserWithNotAllowedCharacters() throws URISyntaxException { // the @ character at the begin of the name is not allowed - String userJson = "{ \"name\": \"@user\", \"type\": \"db\" }"; + String userJson = "{ \"name\": \"@user\",\"active\": true,\"admin\": false,\"displayName\": \"someone\",\"mail\": \"x@example.com\",\"type\": \"db\" }"; MockHttpRequest request = MockHttpRequest .post("/" + UserRootResource.USERS_PATH_V2) .contentType(VndMediaType.USER) @@ -115,7 +115,7 @@ public class UserRootResourceTest { assertEquals(400, response.getStatus()); // the whitespace at the begin opf the name is not allowed - userJson = "{ \"name\": \" user\", \"type\": \"db\" }"; + userJson = "{ \"name\": \" user\",\"active\": true,\"admin\": false,\"displayName\": \"someone\",\"mail\": \"x@example.com\",\"type\": \"db\" }"; request = MockHttpRequest .post("/" + UserRootResource.USERS_PATH_V2) .contentType(VndMediaType.USER)