mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-16 18:26:16 +01:00
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
This commit is contained in:
@@ -103,7 +103,7 @@ public class UserRootResourceTest {
|
|||||||
@Test
|
@Test
|
||||||
public void shouldGet400OnCreatingNewUserWithNotAllowedCharacters() throws URISyntaxException {
|
public void shouldGet400OnCreatingNewUserWithNotAllowedCharacters() throws URISyntaxException {
|
||||||
// the @ character at the begin of the name is not allowed
|
// 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
|
MockHttpRequest request = MockHttpRequest
|
||||||
.post("/" + UserRootResource.USERS_PATH_V2)
|
.post("/" + UserRootResource.USERS_PATH_V2)
|
||||||
.contentType(VndMediaType.USER)
|
.contentType(VndMediaType.USER)
|
||||||
@@ -115,7 +115,7 @@ public class UserRootResourceTest {
|
|||||||
assertEquals(400, response.getStatus());
|
assertEquals(400, response.getStatus());
|
||||||
|
|
||||||
// the whitespace at the begin opf the name is not allowed
|
// 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
|
request = MockHttpRequest
|
||||||
.post("/" + UserRootResource.USERS_PATH_V2)
|
.post("/" + UserRootResource.USERS_PATH_V2)
|
||||||
.contentType(VndMediaType.USER)
|
.contentType(VndMediaType.USER)
|
||||||
|
|||||||
Reference in New Issue
Block a user