Skip to content

Commit 83e1bc7

Browse files
committed
amp-170: add api spec
1 parent c2c654e commit 83e1bc7

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/main/java/uk/gov/hmcts/cp/subscription/client/DocumentServiceClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
)
1212
public interface DocumentServiceClient {
1313
@PostMapping(
14-
value = "/document-service/api/rest/document/metadata",
14+
value = "//client-webhook-url",
1515
consumes = "application/json"
1616
)
1717
void updateDocumentMetadata(@RequestBody PcrEventPayload request);

src/test/java/uk/gov/hmcts/cp/subscription/client/DocumentServiceClientIntegrationTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static void configureProperties(DynamicPropertyRegistry registry) {
5757

5858
@Test
5959
void generateOpenApiModels_should_create_ErrorResponse() {
60-
wireMockServer.stubFor(post(urlEqualTo("/document-service/api/rest/document/metadata"))
60+
wireMockServer.stubFor(post(urlEqualTo("//client-webhook-url"))
6161
.willReturn(aResponse()
6262
.withStatus(204)));
6363

@@ -66,13 +66,13 @@ void generateOpenApiModels_should_create_ErrorResponse() {
6666

6767
documentServiceClient.updateDocumentMetadata(payload);
6868

69-
wireMockServer.verify(postRequestedFor(urlEqualTo("/document-service/api/rest/document/metadata"))
69+
wireMockServer.verify(postRequestedFor(urlEqualTo("//client-webhook-url"))
7070
.withHeader("Content-Type", containing("application/json")));
7171
}
7272

7373
@Test
7474
void should_handle_successful_response() {
75-
wireMockServer.stubFor(post(urlEqualTo("/document-service/api/rest/document/metadata"))
75+
wireMockServer.stubFor(post(urlEqualTo("//client-webhook-url"))
7676
.willReturn(aResponse()
7777
.withStatus(200)));
7878

@@ -82,14 +82,14 @@ void should_handle_successful_response() {
8282
documentServiceClient.updateDocumentMetadata(payload);
8383

8484
wireMockServer.verify(1, postRequestedFor(
85-
urlEqualTo("/document-service/api/rest/document/metadata")));
85+
urlEqualTo("//client-webhook-url")));
8686
}
8787

8888
@Test
8989
void should_send_correct_payload_to_document_service() {
9090
UUID eventId = UUID.randomUUID();
9191

92-
wireMockServer.stubFor(post(urlEqualTo("/document-service/api/rest/document/metadata"))
92+
wireMockServer.stubFor(post(urlEqualTo("//client-webhook-url"))
9393
.willReturn(aResponse()
9494
.withStatus(204)));
9595

@@ -98,7 +98,7 @@ void should_send_correct_payload_to_document_service() {
9898

9999
documentServiceClient.updateDocumentMetadata(payload);
100100

101-
wireMockServer.verify(postRequestedFor(urlEqualTo("/document-service/api/rest/document/metadata"))
101+
wireMockServer.verify(postRequestedFor(urlEqualTo("//client-webhook-url"))
102102
.withHeader("Content-Type", containing("application/json"))
103103
.withRequestBody(matchingJsonPath("$.eventId", equalTo(eventId.toString()))));
104104
}

0 commit comments

Comments
 (0)