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

NIAD-3145: PS Adaptor should reject request with an invalid ConversationId header #781

Merged

Conversation

MartinWheelerMT
Copy link
Collaborator

What

*Create Unit Tests for ConversationIdFilter

  • Add Unit Tests to ensure that Bad Request operational outcomes are returned when an invalid ConversationId is provided.
  • Add package-info.java to resolve warnings around @NonNullApi
  • Update ConversationIdFilter to return Bad Request operational outcomes are returned when an invalid ConversationId is provided.
  • Update README.md to document updated response
  • Update CHANGELOG.md

Why

Currently the GPC Facade endpoint will accept ConversationId headers, where the value is populated but with a value is not a valid UUID.
When given an invalid argument, or missing argument which is required the adaptor should be returning a 400 Bad Request HTTP Error.
This should provide the OperationalOutcome in the content (as specified by GP Connect) detailing the error which has occurred.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have updated the Changelog with details of my change in the UNRELEASED section if this change will affect end users

Add Unit Tests to ensure that `Bad Request` operational outcomes are returned when an invalid `ConversationId` is provided.
Add package-info.java to resolve warnings around @NonNullApi
Update ConversationIdFilter to return `Bad Request` operational outcomes are returned when an invalid `ConversationId` is provided.
Update README.md to document updated response
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This has been added to prevent compiler warnings around @NonNullApi missing from overridden method parameters.

@MartinWheelerMT MartinWheelerMT enabled auto-merge (squash) August 20, 2024 15:43
MartinWheelerMT and others added 5 commits August 21, 2024 10:04
Previously this was using the same random UUID when running the
whole testsuite.

There is no need for this test to use an actually random UUID, so
just hardcode it to reduce the complexity of the test.
Previously this UUID static mock was affecting all tests
which ran after it as the "close" method was never being called.

Instead move into a separate method where its blast area is a lot
smaller.
@MartinWheelerMT MartinWheelerMT merged commit b340ed1 into main Aug 22, 2024
1 check passed
@MartinWheelerMT MartinWheelerMT deleted the niad-3145-reject-request-with-invalid-conversation-id branch August 22, 2024 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants