You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by GitBox <gi...@apache.org> on 2021/11/11 10:00:55 UTC

[GitHub] [james-project] Arsnael commented on a change in pull request #741: JAMES-3667 Add a WebAdmin route for verifying a user password.

Arsnael commented on a change in pull request #741:
URL: https://github.com/apache/james-project/pull/741#discussion_r747360419



##########
File path: server/protocols/webadmin/webadmin-data/src/test/java/org/apache/james/webadmin/routes/UserRoutesTest.java
##########
@@ -776,6 +776,48 @@ void allowedFromHeadersShouldReturn404WhenUserIsInvalid() {
                 .body("message", is("Invalid arguments supplied in the user request"));
         }
 
+        @Test
+        void verifyShouldReturnOkWhenUserPasswordMatches() {
+            with()
+                .body("{\"password\":\"password\"}")
+                .put(USERNAME_WITH_DOMAIN.asString());
+
+            given()
+                .body("{\"password\":\"password\"}")
+                .when()
+                .post(USERNAME_WITH_DOMAIN.asString() + "/verify")
+                .then()
+                .statusCode(HttpStatus.NO_CONTENT_204);

Review comment:
       We have as a convention the habit of putting `when()` and `then()` methods one indent back compare to the rest, to have a better visibility on the steps when sending a request in our tests. Something like this:
   
   ```
   given()
       .body("{\"password\":\"password\"}")
    .when()
       .post(USERNAME_WITH_DOMAIN.asString() + "/verify")
   .then()
       .statusCode(HttpStatus.NO_CONTENT_204);
   ```




-- 
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: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org