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

Implementation to send the FHIR result to RS Waters endpoint #859

Merged
merged 8 commits into from
Feb 12, 2024

Conversation

basiliskus
Copy link
Contributor

@basiliskus basiliskus commented Feb 8, 2024

Implementation to send the FHIR result to RS Waters endpoint

  • Implemented ReportStreamResultSender.send to call RS water API
  • Refactored to extract common code for ReportStreamOrderSender and ReportStreamResultSender into helper class: ReportStreamSenderHelper
  • Added test coverage

Issue

#616

Checklist

  • I have added tests to cover my changes
  • I have added logging where useful (with appropriate log level)
  • I have added JavaDocs where required

@basiliskus basiliskus marked this pull request as ready for review February 9, 2024 22:43
Copy link
Member

@halprin halprin left a comment

Choose a reason for hiding this comment

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

Making sweet sweet progress!

@@ -0,0 +1,78 @@
package gov.hhs.cdc.trustedintermediary.external.reportstream;
Copy link
Member

Choose a reason for hiding this comment

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

I like that we're using a helper class instead of inheritance.

Copy link
Contributor

Choose a reason for hiding this comment

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

Cool, we're also using a helper class as well in our other PR for the Order/Result Conversion use cases.

ReportStreamSenderHelper.getInstance().sendToReportStream(_ as String, _ as String, _ as String)

then:
noExceptionThrown()
Copy link
Member

Choose a reason for hiding this comment

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

No need for noExceptionThrown() if you have another assertion. Spock doesn't allow empty then: statements, so noExceptionThrown() is only needed when it would be the only assertion. No exceptions are allowed to be thrown even if we don't explicitly include the noExceptionThrown() assertion.


then:
noExceptionThrown()
1 * ReportStreamSenderHelper.getInstance().metadata.put(_, EtorMetadataStep.SENT_TO_REPORT_STREAM)
Copy link
Member

@halprin halprin Feb 10, 2024

Choose a reason for hiding this comment

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

Shouldn't we assert more than just that we registered an internal metadata step? It looks like our old test didn't assert anything other than no exception was thrown, but yeah, I think we should at least assert that our RS client was called once.

E.g. something like
1 * mockRsClient.requestWatersEndpoint(_ as String, _ as String).

Copy link

@basiliskus basiliskus mentioned this pull request Feb 12, 2024
4 tasks
@basiliskus basiliskus merged commit 8533fb8 into main Feb 12, 2024
16 checks passed
@basiliskus basiliskus deleted the story/616/send-results-to-rs branch February 12, 2024 17:22
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