-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DTSRD-2139.Update Organisation user idam id endpoint #1562
base: master
Are you sure you want to change the base?
Conversation
|
||
NewUserCreationRequest newUserCreationRequest = | ||
professionalApiClient.createNewUserRequest("[email protected]"); | ||
Map<String, Object> newUserResponse = professionalApiClient.addNewUserToAnOrganisation(orgIdentifier, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dont need to add new user to update idam id for existing user
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
creating a new user as test user to use as existing user for updating id
professionalApiClient.deleteOrganisation(orgIdentifier, hmctsAdmin, NO_CONTENT); | ||
|
||
assertThat(updatedIdamResponse).isNotNull(); | ||
assertThat(professionalUsersResponse).isNotNull(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add assertion to verify that the user's idam id is updated with new id value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
List<Map<String, Object>> professionalUsersResponses = (List<Map<String, Object>>) searchResponse.get("users"); | ||
Map professionalUsersResponse = getUserById(professionalUsersResponses, existingUserId); | ||
|
||
professionalApiClient.deleteOrganisation(orgIdentifier, hmctsAdmin, NO_CONTENT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this line to after assertions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
updateOrganisation(organisationIdentifier, hmctsAdmin, ACTIVE); | ||
|
||
//create new user | ||
List<String> userRoles = new ArrayList<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dont need to add new user
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
creating test user
|
||
|
||
//validate overall response should be 200 always | ||
assertThat(modifiedUserResponse.get("http_status")).isNotNull(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add assertion to verify that the user's idam id is updated with new id value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not fetching id in response
|
||
@Operation( | ||
summary = "Updates idam id for a user in an organisation", | ||
description = "**IDAM Roles to access API** :<br> pui-organisation-manager", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change role name to prd-admin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/main/java/uk/gov/hmcts/reform/professionalapi/service/impl/OrganisationServiceImpl.java
Show resolved
Hide resolved
Response userResponse = userProfileFeignClient | ||
.modifyUserRoles(userProfileUpdatedData, existingUserIdentifier," "); | ||
|
||
Optional<ProfessionalUser> professionalUser = Optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update in PRD only when user profile update is success
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
assertThat(modifiedUserResponse.get("http_status")).isNotNull(); | ||
assertThat(modifiedUserResponse).containsEntry("http_status","400"); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add error scenario test cases for below user profile calls:
- userProfileFeignClient.getUserProfileById
- userProfileFeignClient.modifyUserRoles. (change this method name as its confusing)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added error testcase
|
||
assertThat(modifiedUserResponse.get("http_status")).isNotNull(); | ||
assertThat(modifiedUserResponse).containsEntry("http_status","400"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add test case for error scenario: "Request is empty"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Plan Result (aat)
Change Result (Click me) # azurerm_resource_group.rg will be updated in-place
~ resource "azurerm_resource_group" "rg" {
id = "/subscriptions/1c4f0704-a29e-403d-b719-b90c34ef14c9/resourceGroups/rd-professional-api-aat"
name = "rd-professional-api-aat"
~ tags = {
- "Deployment Environment" = "aat"
- "Team Name" = "RD"
- "lastUpdated" = "2024-07-17T09:07:18Z"
} -> (known after apply)
# (2 unchanged attributes hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy. |
Plan Result (prod)
Change Result (Click me) # azurerm_resource_group.rg will be updated in-place
~ resource "azurerm_resource_group" "rg" {
id = "/subscriptions/8999dec3-0104-4a27-94ee-6588559729d1/resourceGroups/rd-professional-api-prod"
name = "rd-professional-api-prod"
~ tags = {
- "Deployment Environment" = "prod"
- "Team Name" = "RD"
- "lastUpdated" = "2024-07-17T09:18:35Z"
} -> (known after apply)
# (2 unchanged attributes hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy. |
Jira link (if applicable)
Change description
Checklist