Skip to content

Commit

Permalink
feat: added response for update (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
JordenReuter authored Oct 18, 2024
1 parent 030f970 commit f763ed3
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

Expand Down
8 changes: 6 additions & 2 deletions src/main/openapi/openapi-bff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
19 changes: 18 additions & 1 deletion src/test/resources/mockserver/user_profile_admin_api.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "[email protected]",
"firstName": "Superuser",
"lastName": "Capgeminius"
}
}
}
},
{
Expand Down

0 comments on commit f763ed3

Please sign in to comment.