Add provider PACT test for the validate-case-data endpoint#2907
Open
hemantt wants to merge 8 commits into
Open
Add provider PACT test for the validate-case-data endpoint#2907hemantt wants to merge 8 commits into
hemantt wants to merge 8 commits into
Conversation
Verifies consumer contracts published under provider name
ccdDataStoreAPI_validateCaseData against POST /case-types/{caseTypeId}/validate
(CaseDataValidatorController). Uses @IgnoreNoPactsToVerify so the build stays
green when no such contract exists yet.
Adds @IgnoreNoPactsToVerify provider verification (modelled on the existing CasesController/CaseAssignedUserRoles provider tests) for: - case document metadata (CaseDocumentController) - case documents (DocumentController) - external start event triggers (StartEventController) - internal user profile (UIUserProfileController) - internal start trigger (UIStartTriggerController) - internal case view (UICaseController)
Adds @IgnoreNoPactsToVerify provider verification for: - categories & documents / case file view (CaseFileViewController) - case users (CaseUserController) - internal search cases (UICaseSearchController) - internal UI definition (banners, jurisdiction-ui-configs, inputs) (UIDefinitionController) - internal drafts (UIDraftsController)
Verifies the xui_webapp consumer contract published under provider name ccdDataStoreAPI_search (POST /globalSearch, GlobalSearchEndpoint). Implements the 'Search for case id' state to return the payload shape the consumer expects (resultInfo + results with jurisdiction/case-type details).
…tracts
Covers two consumer contracts found in the hmcts org with no provider-side
verification:
- ccdDataStoreAPI_supplementaryUpdate (ia-case-api, ia-bail-case-api):
POST /cases/{caseId}/supplementary-data, state 'Supplementary data updated
successfully'
- ccd_data_store_get_case_by_id (wa-task-management-api):
GET /cases/{caseId}, state 'a case exists'; the experimental header the
endpoint requires is injected via the MockHttpServletRequestBuilder
test-template parameter
The @WebMvcTest/@ContextConfiguration slice did not register the controller beans when the broker was reachable (NoSuchBeanDefinitionException in CI), so all new provider tests are reworked to the established pattern used by uk.gov.hmcts.reform.ccd.pactprovider tests: plain Mockito mocks and manually constructed controllers handed to MockMvcTestTarget, with no Spring context. GetCaseByIdProviderTest injects the required 'experimental' header through a standalone MockMvc default request instead of a test-template parameter, which is not resolvable for 'no pacts found' invocations. Verified locally against a real (empty) pact broker on :9292 - all 18 provider tests pass on the same code path that runs in CI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Verifies consumer contracts published under provider name ccdDataStoreAPI_validateCaseData against POST /case-types/{caseTypeId}/validate (CaseDataValidatorController). Uses @IgnoreNoPactsToVerify so the build stays green when no such contract exists yet.
Before creating a pull request make sure that:
keep-helmlabel has been added, if the helm release should be persisted after a successful buildPlease remove this line and everything above and fill the following sections:
JIRA link (if applicable)
Change description
Does this PR introduce a breaking change? (check one with "x")