diff --git a/src/test/java/uk/nhs/prm/deduction/e2e/models/ContinueRequestMessage.java b/src/test/java/uk/nhs/prm/deduction/e2e/models/ContinueRequestMessage.java index cdfc58c2..49cb6fe4 100644 --- a/src/test/java/uk/nhs/prm/deduction/e2e/models/ContinueRequestMessage.java +++ b/src/test/java/uk/nhs/prm/deduction/e2e/models/ContinueRequestMessage.java @@ -4,6 +4,8 @@ import java.util.UUID; +import static uk.nhs.prm.deduction.e2e.utility.TestUtils.getUuidAsUpperCaseString; + public class ContinueRequestMessage { private UUID conversationId; private UUID messageId; @@ -32,10 +34,10 @@ public String toJsonString() { } public String conversationId() { - return conversationId.toString().toUpperCase(); + return getUuidAsUpperCaseString(conversationId); } public String messageId() { - return messageId.toString().toUpperCase(); + return getUuidAsUpperCaseString(messageId); } } \ No newline at end of file diff --git a/src/test/java/uk/nhs/prm/deduction/e2e/models/ContinueRequestMessageBuilder.java b/src/test/java/uk/nhs/prm/deduction/e2e/models/ContinueRequestMessageBuilder.java index 4dc67f1c..871486b8 100644 --- a/src/test/java/uk/nhs/prm/deduction/e2e/models/ContinueRequestMessageBuilder.java +++ b/src/test/java/uk/nhs/prm/deduction/e2e/models/ContinueRequestMessageBuilder.java @@ -17,7 +17,6 @@ public class ContinueRequestMessageBuilder { private static final Logger LOGGER = LogManager.getLogger(ContinueRequestMessageBuilder.class); - public ContinueRequestMessageBuilder() { withRandomlyGeneratedConversationId(); withRandomlyGeneratedMessageId(); diff --git a/src/test/java/uk/nhs/prm/deduction/e2e/models/EhrRequestMessage.java b/src/test/java/uk/nhs/prm/deduction/e2e/models/EhrRequestMessage.java index 62eeba19..c8d12b44 100644 --- a/src/test/java/uk/nhs/prm/deduction/e2e/models/EhrRequestMessage.java +++ b/src/test/java/uk/nhs/prm/deduction/e2e/models/EhrRequestMessage.java @@ -4,6 +4,8 @@ import java.util.UUID; +import static uk.nhs.prm.deduction.e2e.utility.TestUtils.getUuidAsUpperCaseString; + public class EhrRequestMessage { private final String nhsNumber; private final String sourceGpOds; @@ -35,10 +37,10 @@ public String toJsonString() { } public String conversationId() { - return conversationId.toString().toUpperCase(); + return getUuidAsUpperCaseString(conversationId); } public String messageId() { - return messageId.toString().toUpperCase(); + return getUuidAsUpperCaseString(messageId); } } diff --git a/src/test/java/uk/nhs/prm/deduction/e2e/utility/TestUtils.java b/src/test/java/uk/nhs/prm/deduction/e2e/utility/TestUtils.java index e59a07b0..89c0934e 100644 --- a/src/test/java/uk/nhs/prm/deduction/e2e/utility/TestUtils.java +++ b/src/test/java/uk/nhs/prm/deduction/e2e/utility/TestUtils.java @@ -14,6 +14,7 @@ import java.time.ZonedDateTime; import java.util.List; import java.util.Optional; +import java.util.UUID; import java.util.regex.Pattern; import static uk.nhs.prm.deduction.e2e.nhs.NhsIdentityGenerator.randomNemsMessageId; @@ -161,4 +162,8 @@ public static LargeEhrTestFiles prepareTestFilesForLargeEhr( return new LargeEhrTestFiles(largeEhrCore, largeEhrFragment1, largeEhrFragment2, ehrRequest, continueRequest); } + + public static String getUuidAsUpperCaseString(UUID uuid) { + return uuid.toString().toUpperCase(); + } }