Skip to content

Add provider PACT test for the validate-case-data endpoint#2907

Open
hemantt wants to merge 8 commits into
masterfrom
pact-validate-provider
Open

Add provider PACT test for the validate-case-data endpoint#2907
hemantt wants to merge 8 commits into
masterfrom
pact-validate-provider

Conversation

@hemantt

@hemantt hemantt commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

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:

  • 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)
  • the keep-helm label has been added, if the helm release should be persisted after a successful build

Please 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")

[ ] Yes
[ ] No

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.
hemantt added 2 commits June 9, 2026 21:09
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)
hemantt added 4 commits June 11, 2026 14:33
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.
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.

1 participant