Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PRMT-3411 #25

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

PRMT-3411 #25

wants to merge 6 commits into from

Conversation

MohammadIqbalAD-NHS
Copy link
Contributor

No description provided.

Comment on lines 101 to 102
String port = "5432";
return "jdbc:postgresql://" + hostname + ":" + port + "/" + dbname + "?user=" + username + "&password=" + password;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say the port probably doesn't need a variable of it's own!

Suggested change
String port = "5432";
return "jdbc:postgresql://" + hostname + ":" + port + "/" + dbname + "?user=" + username + "&password=" + password;
return "jdbc:postgresql://" + hostname + ":5432/"+ dbname + "?user=" + username + "&password=" + password;

Comment on lines 99 to 100
// change transfer db status to ACTION:EHR_REQUEST_SENT before putting on inbound queue
// Put the patient into inboundQueueFromMhs as a UK05 message
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove these comments please?

Comment on lines +131 to +141
String inboundConversationId = UUID.randomUUID().toString();
String outboundConversationId = UUID.randomUUID().toString();
LOGGER.info(" =============== outboundConversationId: {}", outboundConversationId);

String largeEhrCoreMessageId = UUID.randomUUID().toString();
String fragment1MessageId = UUID.randomUUID().toString();
String fragment2MessageId = UUID.randomUUID().toString();

String nhsNumberForTestPatient = "9727018157";
String previousGpForTestPatient = "N82668";
String newGpForTestPatient = "M85019";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just popping this in as a note to the discussion we just had - would be beneficial to identify areas that are repeated throughout tests and abstract them out into small POJO's - the builder pattern would be great here!

Comment on lines 66 to 75
@Autowired
public EhrOutE2ETests(
TrackerDb trackerDb,
Gp2gpMessengerQueue gp2gpMessengerQueue,
TestConfiguration config
) {
this.trackerDb = trackerDb;
this.gp2gpMessengerQueue = gp2gpMessengerQueue;
this.config = config;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can substitute this for the following:

Suggested change
@Autowired
public EhrOutE2ETests(
TrackerDb trackerDb,
Gp2gpMessengerQueue gp2gpMessengerQueue,
TestConfiguration config
) {
this.trackerDb = trackerDb;
this.gp2gpMessengerQueue = gp2gpMessengerQueue;
this.config = config;
}
@AllArgsConstructor(onConstructor = @__(@Autowired))

at class level!

Comment on lines +85 to +90
String inboundConversationId = UUID.randomUUID().toString();
String smallEhrMessageId = UUID.randomUUID().toString();
String outboundConversationId = UUID.randomUUID().toString();
String nhsNumberForTestPatient = "9727018440";
String previousGpForTestPatient = "M85019";
String asidCodeForTestPatient = "200000000149";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just popping this in as a note to the discussion we just had - would be beneficial to identify areas that are repeated throughout tests and abstract them out into small POJO's - the builder pattern would be great here!

String asidCodeForTestPatient = "200000000149";
LOGGER.info(" =============== outboundConversationId: {}", outboundConversationId);

SimpleAmqpQueue inboundQueueFromMhs = new SimpleAmqpQueue(config);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this to an instance variable? :)

Suggested change
SimpleAmqpQueue inboundQueueFromMhs = new SimpleAmqpQueue(config);
private static final SimpleAmqpQueue MHS_INBOUND_QUEUE = new SimpleAmqpQueue(config);

Comment on lines 108 to 114
private SqsMessage findMessageContaining(String substring) {
List<SqsMessage> allMessages = thinlyWrappedSqsClient.readThroughMessages(this.queueUri, 180);
for (SqsMessage message : allMessages) {
log(String.format("just finding message, checking conversationId: %s", this.queueUri));
log(String.format("Finding message with substring %s on queue: %s", substring, this.queueUri));
if (message.contains(substring)) {
return message;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    private SqsMessage findMessageContaining(String substring) {
        return thinlyWrappedSqsClient.readThroughMessages(this.queueUri, 180)
                .stream()
                .filter(message -> message.contains(substring))
                .findFirst()
                .orElseThrow(RuntimeException::new);
    }

Comment on lines +38 to +41
testImplementation 'org.jooq:jooq-codegen:3.13.4'
testImplementation 'org.jooq:jooq-meta:3.13.4'
testImplementation 'org.jooq:jooq:3.13.4'
testImplementation 'org.postgresql:postgresql:42.5.4'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reminder: We want to remove these dependencies as we no longer use JOOQ.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants