diff --git a/docs/openapi.yaml b/docs/openapi.yaml index ce50253f..47627715 100644 --- a/docs/openapi.yaml +++ b/docs/openapi.yaml @@ -3428,6 +3428,8 @@ components: type: string title: type: string + description: + type: string results: description: An array of objects type: array @@ -3435,7 +3437,8 @@ components: type: object example: type: urn:dx:rs:success - title: Successfully changed the password + title: successful + detail: Successfully changed the password results: [ { "username": "asasdasd-asdasd-aada-d23342", "apiKey": "asass8a7s" diff --git a/src/main/java/iudx/resource/server/databroker/DataBrokerServiceImpl.java b/src/main/java/iudx/resource/server/databroker/DataBrokerServiceImpl.java index 43ea82a6..367f40c3 100644 --- a/src/main/java/iudx/resource/server/databroker/DataBrokerServiceImpl.java +++ b/src/main/java/iudx/resource/server/databroker/DataBrokerServiceImpl.java @@ -1,11 +1,7 @@ package iudx.resource.server.databroker; -import static iudx.resource.server.databroker.util.Constants.BAD_REQUEST_CODE; -import static iudx.resource.server.databroker.util.Constants.BAD_REQUEST_DATA; -import static iudx.resource.server.databroker.util.Constants.ID; -import static iudx.resource.server.databroker.util.Constants.STATUS; -import static iudx.resource.server.databroker.util.Constants.TYPE; -import static iudx.resource.server.databroker.util.Constants.USER_ID; +import static iudx.resource.server.common.HttpStatusCode.SUCCESS; +import static iudx.resource.server.databroker.util.Constants.*; import io.vertx.core.AsyncResult; import io.vertx.core.Future; @@ -116,6 +112,7 @@ public DataBrokerService getExchange( } return this; } + /* * overridden method */ @@ -838,7 +835,8 @@ public DataBrokerService resetPassword( .onSuccess( successHandler -> { response.put("type", ResponseUrn.SUCCESS_URN.getUrn()); - response.put("title", "Successfully changed the password"); + response.put(TITLE, "successful"); + response.put(DETAIL, "Successfully changed the password"); JsonArray result = new JsonArray() .add(new JsonObject().put("username", userid).put("apiKey", password)); diff --git a/src/test/java/iudx/resource/server/apiserver/integrationTests/resetPasswordAPI/ResetPasswordAPIsIT.java b/src/test/java/iudx/resource/server/apiserver/integrationTests/resetPasswordAPI/ResetPasswordAPIsIT.java index 9c5859a7..978b5930 100644 --- a/src/test/java/iudx/resource/server/apiserver/integrationTests/resetPasswordAPI/ResetPasswordAPIsIT.java +++ b/src/test/java/iudx/resource/server/apiserver/integrationTests/resetPasswordAPI/ResetPasswordAPIsIT.java @@ -32,7 +32,8 @@ void ResetUserPwd() { .post("/user/resetPassword") .then() .statusCode(200) - .body("title", equalTo("Successfully changed the password")) + .body("title", equalTo("successful")) + .body("detail", equalTo("Successfully changed the password")) .extract() .response(); } diff --git a/src/test/java/iudx/resource/server/databroker/DBServiceImplTest.java b/src/test/java/iudx/resource/server/databroker/DBServiceImplTest.java index 77c65663..e708f0bb 100644 --- a/src/test/java/iudx/resource/server/databroker/DBServiceImplTest.java +++ b/src/test/java/iudx/resource/server/databroker/DBServiceImplTest.java @@ -386,7 +386,7 @@ public void test_resetPassword_success(VertxTestContext vertxTestContext) { String actual = object.getString("username"); assertEquals("Dummy User ID", actual); assertEquals("urn:dx:rs:success", handler.result().getString("type")); - assertEquals("Successfully changed the password", handler.result().getString("title")); + assertEquals("successful", handler.result().getString("title")); assertNotNull(handler.result().getString("result")); vertxTestContext.completeNow(); } else { diff --git a/src/test/resources/IUDX-Resource-Server-Consumer-APIs-V5.5.0.postman_collection.json b/src/test/resources/IUDX-Resource-Server-Consumer-APIs-V5.5.0.postman_collection.json index c9d4bfb7..ad650f5c 100644 --- a/src/test/resources/IUDX-Resource-Server-Consumer-APIs-V5.5.0.postman_collection.json +++ b/src/test/resources/IUDX-Resource-Server-Consumer-APIs-V5.5.0.postman_collection.json @@ -22432,7 +22432,7 @@ "pm.test(\"Check response body\", function () { ", " const body = pm.response.json();", " pm.expect(body).to.have.property(\"type\", \"urn:dx:rs:success\");", - " pm.expect(body).to.have.property(\"title\", \"Successfully changed the password\");", + " pm.expect(body).to.have.property(\"title\", \"successful\");", " pm.expect(body).to.have.property(\"result\");", " const resultsjsonData = body.result[0];", " pm.expect(resultsjsonData).to.have.property(\"username\");",