-
Notifications
You must be signed in to change notification settings - Fork 0
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-6149] increase ab2d-filters
test coverage
#388
Conversation
ExplanationOfBenefit eobSNF = (ExplanationOfBenefit) eobS; | ||
List<org.hl7.fhir.dstu3.model.Identifier> ids = eobSNF.getIdentifier(); | ||
assertNotNull(ids); | ||
assertEquals(ids.size(), 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The syntax is assertEquals(expected, actual)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Second that !
@@ -30,7 +30,7 @@ public class EOBLoadUtilitiesTest { | |||
} | |||
|
|||
@Test | |||
public void testType() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests don't need to be marked public
ab2d-filters
test coverage
// Our mock FhirVersion class is used to test the switch case statement inside of EOBLoadUtilities.getEOBFromReader. | ||
// We need to extend from a FhirVersionEnum that is actually on our classpath, so we extend from the R4 version. | ||
// We then override the getVersion method to return a version that is not supported by the switch case statement. | ||
// Choosing `FhirVersionEnum.R5` as the version to return here was an arbitrary choice. If we ever add support | ||
// for R5, this test will need to be updated. | ||
class MockFhirVersion extends org.hl7.fhir.r4.hapi.ctx.FhirR4{ | ||
public FhirVersionEnum getVersion() { | ||
return FhirVersionEnum.R5; | ||
} | ||
} | ||
class MockFhirContext extends FhirContext { | ||
@Override | ||
public IFhirVersion getVersion() { | ||
return new MockFhirVersion(); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if you can think of a better way to do this
@Test | ||
void testGetStartDate() { | ||
assertNull(EobUtils.getStartDate(eob1)); | ||
assertNotNull(EobUtils.getStartDate(eob2)); | ||
assertNull(EobUtils.getStartDate(eob3)); | ||
assertNull(EobUtils.getStartDate((ExplanationOfBenefit) null)); | ||
} | ||
|
||
@Test | ||
void testGetEndDate() { | ||
assertNull(EobUtils.getEndDate(eob1)); | ||
assertNotNull(EobUtils.getEndDate(eob2)); | ||
assertNull(EobUtils.getEndDate(eob3)); | ||
assertNull(EobUtils.getEndDate((ExplanationOfBenefit) null)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lazily choosing not to assert on the actual dates here
ExplanationOfBenefit eobSNF = (ExplanationOfBenefit) eobS; | ||
List<org.hl7.fhir.dstu3.model.Identifier> ids = eobSNF.getIdentifier(); | ||
assertNotNull(ids); | ||
assertEquals(ids.size(), 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Second that !
} | ||
|
||
// DSTU3 | ||
InputStream inputStream = classLoader.getResourceAsStream("eobdata/EOB-for-Carrier-Claims.json"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add the file paths to constants? but I do understand if you dont want to since they are just being used few times in here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather keep it as is, if that's okay!
🎫 Ticket
https://jira.cms.gov/browse/AB2D-6149
🛠 Changes
EobUtils
to handle a NPEEobUtils
andEOBLoadUtilities
, both of which should be at 100% test coverage nowℹ️ Context for reviewers
SonarQube isn't updating the code coverage stats for my PR, so I won't know how much I've increased code coverage until after the merge (I think)
🔒 Security Implications
If any security implications apply, add Jason Ashbaugh (GitHub username: StewGoin) as a reviewer and do not merge this PR without his approval.