diff --git a/docs/modules/onecx-user-profile-bff/pages/onecx-user-profile-bff-extensions.adoc b/docs/modules/onecx-user-profile-bff/pages/onecx-user-profile-bff-extensions.adoc index 215b94b..11ef15b 100644 --- a/docs/modules/onecx-user-profile-bff/pages/onecx-user-profile-bff-extensions.adoc +++ b/docs/modules/onecx-user-profile-bff/pages/onecx-user-profile-bff-extensions.adoc @@ -89,8 +89,8 @@ h| Version | onecx-permissions | https://onecx.github.io/docs/onecx-quarkus/current/onecx-quarkus/onecx-permissions.html[Link] -| https://github.com/onecx/onecx-quarkus/blob/0.32.0/docs/modules/onecx-quarkus/pages/includes/onecx-permissions.adoc[Link] -| 0.32.0 +| https://github.com/onecx/onecx-quarkus/blob/0.33.0/docs/modules/onecx-quarkus/pages/includes/onecx-permissions.adoc[Link] +| 0.33.0 | quarkus-oidc @@ -108,7 +108,7 @@ h| Version | https://onecx.github.io/docs/onecx-quarkus/current/onecx-quarkus/onecx-core.html[Link] | -| 0.32.0 +| 0.33.0 | quarkus-micrometer-registry-prometheus diff --git a/src/main/java/org/tkit/onecx/user/profile/bff/rs/controllers/UserProfileAdminRestController.java b/src/main/java/org/tkit/onecx/user/profile/bff/rs/controllers/UserProfileAdminRestController.java index 08b2909..2e1713d 100644 --- a/src/main/java/org/tkit/onecx/user/profile/bff/rs/controllers/UserProfileAdminRestController.java +++ b/src/main/java/org/tkit/onecx/user/profile/bff/rs/controllers/UserProfileAdminRestController.java @@ -63,7 +63,8 @@ public Response searchUserProfile(UserPersonCriteriaDTO userPersonCriteriaDTO) { @Override public Response updateUserProfile(String id, UpdateUserPersonRequestDTO updateUserPersonRequestDTO) { try (Response response = client.updateUserProfileData(id, mapper.map(updateUserPersonRequestDTO))) { - return Response.status(response.getStatus()).build(); + var userProfile = response.readEntity(UserProfile.class); + return Response.status(response.getStatus()).entity(mapper.map(userProfile)).build(); } } diff --git a/src/main/openapi/openapi-bff.yaml b/src/main/openapi/openapi-bff.yaml index fa4ef27..6fcf9b1 100644 --- a/src/main/openapi/openapi-bff.yaml +++ b/src/main/openapi/openapi-bff.yaml @@ -415,8 +415,12 @@ paths: schema: $ref: '#/components/schemas/UpdateUserPersonRequest' responses: - "204": - description: User profile updated + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UserProfile' "400": description: Bad request content: diff --git a/src/test/java/org/tkit/onecx/user/profile/bff/rs/UserProfileAdminRestControllerTest.java b/src/test/java/org/tkit/onecx/user/profile/bff/rs/UserProfileAdminRestControllerTest.java index 50b4cb3..9dae4c0 100644 --- a/src/test/java/org/tkit/onecx/user/profile/bff/rs/UserProfileAdminRestControllerTest.java +++ b/src/test/java/org/tkit/onecx/user/profile/bff/rs/UserProfileAdminRestControllerTest.java @@ -245,7 +245,9 @@ void updateUserProfileTest() { .body(new UserPersonCriteriaDTO()) .put("/user1") .then() - .statusCode(Response.Status.NO_CONTENT.getStatusCode()); + .contentType(APPLICATION_JSON) + .statusCode(Response.Status.OK.getStatusCode()) + .extract().as(UserProfileDTO.class); // standard USER will get FORBIDDEN without WRITE permission given() diff --git a/src/test/resources/mockserver/user_profile_admin_api.json b/src/test/resources/mockserver/user_profile_admin_api.json index dd011f3..ecb015c 100644 --- a/src/test/resources/mockserver/user_profile_admin_api.json +++ b/src/test/resources/mockserver/user_profile_admin_api.json @@ -185,7 +185,24 @@ "method": "PUT" }, "httpResponse": { - "statusCode": 204 + "statusCode": 200, + "headers": { + "content-type": [ + "application/json" + ] + }, + "body": { + "userId": "user1", + "organization": "capgemini", + "identityProvider": "database", + "identityProviderId": "db", + "person" : { + "displayName": "Capgemini super user", + "email": "cap@capgemini.com", + "firstName": "Superuser", + "lastName": "Capgeminius" + } + } } }, {