From 45644927c380ebfd7124f830824c5751f728f529 Mon Sep 17 00:00:00 2001 From: Herman Wika Horn Date: Mon, 29 Apr 2024 19:34:52 +0200 Subject: [PATCH] New document event: SHARE_DOCUMENTS_REQUEST_SHARING_WITHDRAWN This event is generated whenever an active ShareDocumentsRequest is stopped or the sharing is withdrawn. The same event is generated in either case. This event is always generated for the Broker, not the Sender, so that Brokers may poll events for a number of different Senders using the same endpoint and parameters. --- .../representations/DocumentEventType.java | 3 ++- src/main/resources/xsd/api_v8.xsd | 2 ++ .../representations/XsdValidationTest.java | 18 +++++++++++++++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/main/java/no/digipost/api/client/representations/DocumentEventType.java b/src/main/java/no/digipost/api/client/representations/DocumentEventType.java index a9cf2de8..a65ffa1c 100644 --- a/src/main/java/no/digipost/api/client/representations/DocumentEventType.java +++ b/src/main/java/no/digipost/api/client/representations/DocumentEventType.java @@ -33,6 +33,7 @@ public enum DocumentEventType { PEPPOL_FAILED, PEPPOL_DELIVERED, SHREDDED, - SHARE_DOCUMENTS_REQUEST_DOCUMENTS_SHARED + SHARE_DOCUMENTS_REQUEST_DOCUMENTS_SHARED, + SHARE_DOCUMENTS_REQUEST_SHARING_WITHDRAWN } diff --git a/src/main/resources/xsd/api_v8.xsd b/src/main/resources/xsd/api_v8.xsd index d5fa29fd..c499b674 100644 --- a/src/main/resources/xsd/api_v8.xsd +++ b/src/main/resources/xsd/api_v8.xsd @@ -1107,6 +1107,8 @@ + + diff --git a/src/test/java/no/digipost/api/client/representations/XsdValidationTest.java b/src/test/java/no/digipost/api/client/representations/XsdValidationTest.java index a6d23082..5f96a805 100644 --- a/src/test/java/no/digipost/api/client/representations/XsdValidationTest.java +++ b/src/test/java/no/digipost/api/client/representations/XsdValidationTest.java @@ -41,6 +41,8 @@ import static no.digipost.api.client.representations.DocumentEventType.OPENED; import static no.digipost.api.client.representations.DocumentEventType.POSTMARKED; import static no.digipost.api.client.representations.DocumentEventType.PRINT_FAILED; +import static no.digipost.api.client.representations.DocumentEventType.SHARE_DOCUMENTS_REQUEST_DOCUMENTS_SHARED; +import static no.digipost.api.client.representations.DocumentEventType.SHARE_DOCUMENTS_REQUEST_SHARING_WITHDRAWN; import static no.digipost.api.client.representations.DocumentEventType.SHREDDED; import static no.digipost.api.client.representations.DocumentEventType.SMS_NOTIFICATION_FAILED; import static no.digipost.api.client.representations.ErrorType.CLIENT_DATA; @@ -214,9 +216,23 @@ public void validateDocumentEvents() { DocumentEvent shreddedEvent = new DocumentEvent(randomUUID(), SHREDDED, now, now); + DocumentEvent newSharedDocuments = new DocumentEvent( + randomUUID(), + SHARE_DOCUMENTS_REQUEST_DOCUMENTS_SHARED, + now, + now + ); + + DocumentEvent sharingWithdrawn = new DocumentEvent( + randomUUID(), + SHARE_DOCUMENTS_REQUEST_SHARING_WITHDRAWN, + now, + now + ); + DocumentEvents documentEvents = new DocumentEvents(asList(openedEvent, emailDeliveredEvent, emailDeliveredEventWithMetadata, failedEmailNotificationEvent, failedSmsNotificationEvent, - printFailedEvent, movedFilesEvent, postmarkedEvent, shreddedEvent)); + printFailedEvent, movedFilesEvent, postmarkedEvent, shreddedEvent, newSharedDocuments, sharingWithdrawn)); marshallValidateAndUnmarshall(documentEvents); }