From 999735cd24a0c97edfd5ca3a8181d77fbc5f5de9 Mon Sep 17 00:00:00 2001
From: Martin Vogel <martin.vogel@sinc.de>
Date: Mon, 12 Jun 2023 20:09:25 +0200
Subject: [PATCH] refactor(#1073): adjust error message assertions

---
 .../dev/fitko/fitconnect/client/SubscriberClientTest.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/client/src/test/java/dev/fitko/fitconnect/client/SubscriberClientTest.java b/client/src/test/java/dev/fitko/fitconnect/client/SubscriberClientTest.java
index a9085e2e2..0c251d820 100644
--- a/client/src/test/java/dev/fitko/fitconnect/client/SubscriberClientTest.java
+++ b/client/src/test/java/dev/fitko/fitconnect/client/SubscriberClientTest.java
@@ -389,7 +389,7 @@ class SubscriberClientTest {
         final FitConnectSubscriberException exception = assertThrows(FitConnectSubscriberException.class, () -> underTest.requestSubmission(submissionId));
 
         // Then
-        assertThat(exception.getCause().getMessage(), containsString("Metadata is invalid"));
+        assertThat(exception.getCause().getMessage(), containsString("The authentication tag for the metadata is invalid"));
         verify(subscriberMock, times(1)).rejectSubmission(EventPayload.forRejectEvent(submission, List.of(problem)));
     }
 
@@ -556,7 +556,7 @@ class SubscriberClientTest {
         final FitConnectSubscriberException exception = assertThrows(FitConnectSubscriberException.class, () -> underTest.requestSubmission(submissionId));
 
         // Then
-        assertThat(exception.getCause().getMessage(), containsString("Data is invalid"));
+        assertThat(exception.getCause().getMessage(), containsString("Submission data checksum wrong"));
         verify(subscriberMock, times(1)).rejectSubmission(EventPayload.forRejectEvent(submission, List.of(problem)));
 
     }
@@ -613,7 +613,7 @@ class SubscriberClientTest {
         final FitConnectSubscriberException exception = assertThrows(FitConnectSubscriberException.class, () -> underTest.requestSubmission(submissionId));
 
         // Then
-        assertThat(exception.getCause().getMessage(), containsString("Data is invalid"));
+        assertThat(exception.getCause().getMessage(), containsString("Submission data does not comply to schema"));
         verify(subscriberMock, times(1)).rejectSubmission(EventPayload.forRejectEvent(submission, List.of(problem)));
     }
 
@@ -682,7 +682,7 @@ class SubscriberClientTest {
         final FitConnectSubscriberException exception = assertThrows(FitConnectSubscriberException.class, () -> underTest.requestSubmission(submissionId));
 
         // Then
-        assertThat(exception.getCause().getMessage(), containsString("Attachment validation failed"));
+        assertThat(exception.getCause().getMessage(), containsString("The authentication tag for the attachment " + attachment.getAttachmentId() + " is invalid"));
         verify(subscriberMock, times(1)).rejectSubmission(EventPayload.forRejectEvent(submission, List.of(problem)));
     }
 
-- 
GitLab