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

[AB2D-6148] increase ab2d-fhir code coverage #396

Merged
merged 11 commits into from
Jun 24, 2024
Merged

[AB2D-6148] increase ab2d-fhir code coverage #396

merged 11 commits into from
Jun 24, 2024

Conversation

coilysiren
Copy link
Contributor

@coilysiren coilysiren commented Jun 21, 2024

🎫 Ticket

https://jira.cms.gov/browse/AB2D-6148

🛠 Changes

  • Adds a FhirVersion.getClassFromName function, which is patterned off of the other methods in that file. It is a simple class that calls Class.forName(...) and logs all exceptions.
  • Changes ExtensionUtils to use FhirVersion.getClassFromName. This means that ExtensionUtils can get rid of a few try ... except blocks that were functionally dead code. Those lines were dead code because they were calling Class.forName(...) on static strings... so they were never going to raise an exception. Hence, it was impossible to test them in their previous form.
  • Adds tests for the above.

ℹ️ Context

The goal of this PR is to increase test coverage for our code. At present ExtensionUtils has the lowest test coverage of all the files in this folder. Unfortunately, none of the code is "easy" to test, so I'm having to resort to code changes to get test coverage any higher.

image

The code I added has 100% test coverage 😎 . Additionally, FhirVersion and ExtensionUtils now both have 100% test coverage as well.

image

@coilysiren coilysiren changed the title Ab2 d 6148 p3 [AB2D-6148] increase ab2d-fhir code coverage Jun 21, 2024
@coilysiren coilysiren marked this pull request as ready for review June 21, 2024 23:02
@coilysiren coilysiren requested a review from a team as a code owner June 21, 2024 23:02
Copy link
Contributor

@Rwolfe-Nava Rwolfe-Nava left a comment

Choose a reason for hiding this comment

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

Minor suggestion / question regarding assertions, but otherwise looks good to me.

@coilysiren coilysiren merged commit d2783b5 into main Jun 24, 2024
2 of 3 checks passed
@coilysiren coilysiren deleted the AB2D-6148-p3 branch June 24, 2024 19:01
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