Skip to content
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-2137. Update SRA Id #1668

Open
wants to merge 73 commits into
base: master
Choose a base branch
from
Open

DTSRD-2137. Update SRA Id #1668

wants to merge 73 commits into from

Conversation

SabinaHMCTS
Copy link
Contributor

Jira link

See PROJ-XXXXXX

Change description

Testing done

Checklist

  • commit messages are meaningful and follow good commit message guidelines
  • README and other documentation has been updated / added (if needed)
  • tests have been updated / new tests has been added (if needed)
  • Does this PR introduce a breaking change

SabinaHMCTS and others added 30 commits February 19, 2024 13:48


@Operation(
summary = "Updates an Organisation's name",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update swagger documentation for SRA Id, looks like copied from update organisation name endpoint

OrganisationSraUpdateRequest organisationSraUpdateRequest, String organisationIdentifier) {

var existingOrganisation = organisationRepository.findByOrganisationIdentifier(organisationIdentifier);
Organisation savedOrganisation = null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove unused variable

final String attributeValue = "{\"regulatorType\":\"Solicitor Regulation Authority (SRA)\","
+ "\"organisationRegistrationNumber\":\"" + organisationNameSraUpdateRequest.getSraId() + "\"}";

existingOrganisation.setSraId(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate existingOrganisation.setSraId , it is already added in updateOrganisationSra method


LocalDateTime updatedDate = LocalDateTime.parse(orgResponse.get("lastUpdated").toString());
assertThat(updatedDate.toLocalDate()).isEqualTo(LocalDate.now());

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add delete organisation call


assertNotNull(orgUpdatedSraIdResponse);
assertThat(orgUpdatedSraIdResponse.statusCode()).isEqualTo(400);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add assertion for error message

@Secured({"prd-admin"})
public ResponseEntity<Object> updateOrganisationSra(
@io.swagger.v3.oas.annotations.parameters.RequestBody(description = "organisationsraUpdateRequest")
@Valid @NotNull @RequestBody OrganisationSraUpdateRequest organisationSraUpdateRequest,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change endpoint to accept list of organisation ids and sra ids similar to update org name endpoint and if any org id is failed to update then return error message for those failed org id's

}

@Test
void updateOrganisationSraIdShouldReturnSuccess() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modify test case to update multiple sra ids


log.info("updateOrganisationSraIdShouldReturnSuccess :: END");
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add test case for partial success sra ids update

updateOrganisation(organisationIdentifier, hmctsAdmin, "ACTIVE");

return organisationIdentifier;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add test case for partial success sra ids update



@Test
void update_sra_of_an_active_organisation_with_prd_admin_role_should_return_200() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modify test case to update multiple sra ids

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants