Skip to content

Commit

Permalink
[PRMT-3413] Address comments and add a static method getUuidAsUpperCa…
Browse files Browse the repository at this point in the history
…seString to TestUtils
  • Loading branch information
joefong-nhs committed Jun 15, 2023
1 parent f3cc475 commit 8f6eaf9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public class ContinueRequestMessageBuilder {

private static final Logger LOGGER = LogManager.getLogger(ContinueRequestMessageBuilder.class);


public ContinueRequestMessageBuilder() {
withRandomlyGeneratedConversationId();
withRandomlyGeneratedMessageId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}
5 changes: 5 additions & 0 deletions src/test/java/uk/nhs/prm/deduction/e2e/utility/TestUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}
}

0 comments on commit 8f6eaf9

Please sign in to comment.