-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Fixes a bug caused during the adjustment to use dependency injection in RDA code which was miscasting the response during the SAMHSA check.
- 999.999.999-norelease
- 24.01.05-test2
- 24.01.05-test1
- 17.8.9-test6
- 17.8.9-test4
- 2.170.0
- 2.169.0
- 2.168.0
- 2.167.1
- 2.167.0
- 2.166.0
- 2.166.0-test
- 2.165.0
- 2.164.0
- 2.163.0
- 2.162.0
- 2.162.0-3101-1
- 2.161.0
- 2.160.0
- 2.159.0
- 2.158.0
- 2.157.0
- 2.156.0
- 2.155.0
- 2.154.0
- 2.153.0
- 2.152.0
- 2.151.0
- 2.150.0
- 2.150.0-0
- 2.149.0
- 2.148.0
- 2.147.0
- 2.146.0
- 2.145.0
- 2.144.0
- 2.142.1
- 2.142.0
- 2.141.0
- 2.140.0
- 2.139.0
- 2.138.0
- 2.137.0
- 2.136.0
- 2.135.0
- 2.134.0
- 2.133.0
- 2.132.0
- 2.131.0
- 2.130.0
- 2.129.0
- 2.128.0
- 2.127.0
- 2.126.0
- 2.125.0
- 2.124.0
- 2.123.0
- 2.122.0
- 2.121.0
- 2.120.1
- 2.120.0
- 2.119.0
- 2.119.0-3130-5
- 2.119.0-3130-4
- 2.119.0-3130-3
- 2.119.0-3130-2
- 2.119.0-3130-1
- 2.119.0-3130-0
- 2.118.0
- 2.117.0
- 2.116.0
- 2.115.0
- 2.114.0
- 2.113.0
- 2.112.0
- 2.111.0
- 2.110.2
- 2.110.1
- 2.110.0
- 2.109.1
- 2.109.0
- 2.108.0
- 2.107.0
- 2.106.0
- 2.105.0
- 2.104.0
- 2.103.0
- 2.102.0
- 2.101.1
- 2.101.0
- 2.100.0
- 2.100.0-3244-2
- 2.100.0-3219-1
- 2.99.0
- 2.97.0
- 2.96.0
- 2.95.0
- 2.94.0
- 2.93.0
- 2.92.0
- 2.91.0
- 2.90.0
- 2.89.0
- 2.89.0-3149-1
- 2.89.0-3120-2
- 2.89.0-3120-1
- 2.89.0-3030-1
- 2.88.0
- 2.87.0
- 2.86.1
- 2.86.0
- 2.85.0
- 2.84.3
- 2.84.2
- 2.84.1
- 2.84.0
- 2.83.8
- 2.83.7
- 2.83.6
- 2.83.5
- 2.83.4
- 2.83.3
- 2.83.2
- 2.83.0
- 2.82.0
- 2.81.0
- 2.80.0
- 2.79.0
- 2.78.0
- 2.77.0
- 2.76.0
- 2.75.0
- 2.74.0
- 2.73.0
- 2.72.0
- 2.71.0
- 2.70.0
- 2.69.0
- 2.68.0
- 2.67.0
- 2.66.0
- 2.65.0
- 2.64.0
- 2.63.0
- 2.62.0
- 2.61.0
- 2.60.0
- 2.59.0
- 2.58.0
- 2.57.0
- 2.56.0
- 2.55.0
- 2.54.0
- 2.53.0
- 2.52.0
- 2.51.0
- 2.50.0
- 2.49.0
- 2.48.0
- 2.47.0
- 2.46.0
- 2.45.0
- 2.44.0
- 2.43.0
- 2.42.0
- 2.41.0
- 2.40.0
- 2.39.0
- 2.38.0
- 2.37.0
- 2.36.0
- 2.35.0
- 2.34.0
- 2.33.0
- 2.32.0
- 2.31.0
- 2.30.0
- 2.29.0
- 2.28.0
- 2.27.0
- 2.26.0
- 2.25.0
- 2.24.0
- 2.23.0
- 2.22.0
- 2.21.0
- 2.20.0
- 2.19.0
- 2.18.1
1 parent
f7d4f2a
commit 31a903f
Showing
5 changed files
with
156 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
...r-war/src/test/java/gov/cms/bfd/server/war/r4/providers/pac/R4ClaimSamhsaMatcherTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
package gov.cms.bfd.server.war.r4.providers.pac; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
import static org.mockito.ArgumentMatchers.any; | ||
import static org.mockito.ArgumentMatchers.anyBoolean; | ||
import static org.mockito.Mockito.mock; | ||
import static org.mockito.Mockito.when; | ||
|
||
import gov.cms.bfd.model.rda.RdaFissClaim; | ||
import gov.cms.bfd.model.rda.RdaMcsClaim; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
import org.hl7.fhir.r4.model.Claim; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.ExtendWith; | ||
import org.mockito.Mock; | ||
import org.mockito.junit.jupiter.MockitoExtension; | ||
import org.mockito.junit.jupiter.MockitoSettings; | ||
import org.mockito.quality.Strictness; | ||
|
||
/** Tests the methods of the {@link R4ClaimSamhsaMatcher}. */ | ||
@ExtendWith(MockitoExtension.class) | ||
@MockitoSettings(strictness = Strictness.LENIENT) | ||
public class R4ClaimSamhsaMatcherTest { | ||
|
||
/** The class under test. */ | ||
private R4ClaimSamhsaMatcher samhsaMatcher; | ||
|
||
/** The fiss claim transformer. */ | ||
@Mock private FissClaimTransformerV2 mockFissTransformer; | ||
|
||
/** The mock mcs claim transformer. */ | ||
@Mock private McsClaimTransformerV2 mockMcsTransformer; | ||
|
||
/** The mock claim returned by the transformers. */ | ||
@Mock private Claim mockClaim; | ||
|
||
/** Sets up the class under test and dependencies. */ | ||
@BeforeEach | ||
public void setup() { | ||
samhsaMatcher = new R4ClaimSamhsaMatcher(mockFissTransformer, mockMcsTransformer); | ||
when(mockFissTransformer.transform(any(), anyBoolean())).thenReturn(mockClaim); | ||
when(mockMcsTransformer.transform(any(), anyBoolean())).thenReturn(mockClaim); | ||
List<Claim.ProcedureComponent> procedureComponentList = new ArrayList<>(); | ||
when(mockClaim.getProcedure()).thenReturn(procedureComponentList); | ||
} | ||
|
||
/** | ||
* Tests that the samhsa checker is invoked and returns true when a mcs claim with no data is | ||
* passed, as the matches should have nothing to match as a positive samhsa result. | ||
*/ | ||
@Test | ||
public void testHasNoSamhsaDataWhenMcsClaimResponseWithNoDataExpectTrue() { | ||
|
||
RdaMcsClaim mcsClaim = mock(RdaMcsClaim.class); | ||
|
||
boolean hasNoSamhsa = samhsaMatcher.hasNoSamhsaData(mcsClaim); | ||
|
||
assertTrue(hasNoSamhsa); | ||
} | ||
|
||
/** | ||
* Tests that the samhsa checker is invoked and returns true when a fiss claim with no data is | ||
* passed, as the matches should have nothing to match as a positive samhsa result. | ||
*/ | ||
@Test | ||
public void testHasNoSamhsaDataWhenFissClaimResponseWithNoDataExpectTrue() { | ||
|
||
RdaFissClaim fissClaim = mock(RdaFissClaim.class); | ||
|
||
boolean hasNoSamhsa = samhsaMatcher.hasNoSamhsaData(fissClaim); | ||
|
||
assertTrue(hasNoSamhsa); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters