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 2140 #1583

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

Dtsrd 2140 #1583

wants to merge 39 commits into from

Conversation

SabinaHMCTS
Copy link
Contributor

Jira link (if applicable)

Change description

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

aneesaHMCTS
aneesaHMCTS previously approved these changes May 22, 2024
log.info("deletePbaOfExistingOrganisationShouldBeForbiddenWhenLDOff :: STARTED");

setUpTestData();
String bearerToken = inviteUser(puiFinanceManager, intActiveOrgId, generateRandomEmail(),
Copy link
Contributor

Choose a reason for hiding this comment

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

dont need to invite another user to delete payment account ? for internal endpoint prd-admin only allowed to delete payment account.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

deletePbaRequest.setPaymentAccounts(Set.of("PBA0000021", "PBA0000022", "PBA0000023"));

professionalApiClient.deletePaymentAccountsOfOrganisation(deletePbaRequest,
professionalApiClient.getMultipleAuthHeaders(bearerToken), BAD_REQUEST);
Copy link
Contributor

Choose a reason for hiding this comment

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

incorrect status code bad request, api should return 403 when feature is toggled off

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

String intActiveOrgId = createAndActivateOrganisationWithGivenRequest(organisationCreationRequest,
hmctsAdmin);

String bearerToken = inviteUser(puiFinanceManager, intActiveOrgId, generateRandomEmail(),
Copy link
Contributor

Choose a reason for hiding this comment

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

dont need to invite finance manager user to delete payment account, remove this line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

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

public String inviteUser(String role,
Copy link
Contributor

Choose a reason for hiding this comment

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

this method not required, remove it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done , removed

PbaRequest deletePbaRequest = new PbaRequest();
deletePbaRequest.setPaymentAccounts(Set.of("PBA0000021", "PBA0000022", "PBA0000023"));

professionalApiClient.deletePaymentAccountsOfOrganisation(deletePbaRequest,
Copy link
Contributor

Choose a reason for hiding this comment

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

this line making a call to existing external endpoint, so this test is invalid. make change to call new internal endpoint with prd-admin user

PbaRequest deletePbaRequest = new PbaRequest();
deletePbaRequest.setPaymentAccounts(organisationCreationRequest.getPaymentAccount());

professionalApiClient.deletePaymentAccountsOfOrganisation(deletePbaRequest,
Copy link
Contributor

Choose a reason for hiding this comment

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

this line making a call to existing external endpoint, so this test is invalid. make change to call new internal endpoint with prd-admin user

deletePbaRequest.setPaymentAccounts(organisationCreationRequest.getPaymentAccount());

professionalApiClient.deletePaymentAccountsOfOrganisation(deletePbaRequest,
professionalApiClient.getMultipleAuthHeaders(bearerToken), NO_CONTENT);
Copy link
Contributor

Choose a reason for hiding this comment

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

wrong user token used, it should be prd-user token


@Operation(
summary = "Deletes the provided list of payment accounts from the organisation.",
description = "**IDAM Roles to access API** : <br> - pui-finance-manager",
Copy link
Contributor

Choose a reason for hiding this comment

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

wrong role , it should be prd-admin

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

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.

6 participants