chibenwa commented on a change in pull request #678:
URL: https://github.com/apache/james-project/pull/678#discussion_r721019481
##########
File path:
server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/GroupsRoutesTest.java
##########
@@ -319,6 +324,26 @@ void putShouldDetectLoops() {
.containsEntry("message", "Creation of redirection of
[email protected] to group:[email protected] would lead to a loop, operation not
performed");
}
+ @Test
+ void putShouldNotConflictWithAlias() throws Exception {
+
memoryRecipientRewriteTable.addAliasMapping(MappingSource.fromUser(Username.of(GROUP1)),
USER_A);
+
+ Map<String, Object> errors = when()
+ .put(GROUP1 + SEPARATOR + USER_A)
+ .then()
+ .contentType(ContentType.JSON)
+ .statusCode(HttpStatus.CONFLICT_409)
+ .extract()
+ .body()
+ .jsonPath()
+ .getMap(".");
+
+ assertThat(errors)
+ .containsEntry("statusCode", HttpStatus.CONFLICT_409)
+ .containsEntry("type", "WrongState")
+ .containsEntry("message", "'[email protected]' already have
associated mappings: alias:[email protected]");
+ }
+
Review comment:
```
GIVEN a group [email protected]
WHEN I create the group [email protected]
THEN it fails
```
Actually no: you only add member to a group. And of course a group can have
several members.
```
GIVEN a group [email protected]
WHEN I create the group [email protected]
THEN it fails
```
This is covered in user route tests...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]