Summary Table
Categories |
Total Count |
PII |
0 |
URL |
0 |
DNS |
1 |
EKL |
0 |
IP |
0 |
PORT |
0 |
VsID |
0 |
CF |
0 |
AI |
0 |
VPD |
0 |
PL |
0 |
Other |
0 |
File Content
/**
* This only implements the simplest tests with noVal, loVal and hiVal.
* No edge cases are explored.
*/
package gov.va.med.ewv.util;
import static gov.va.med.ewv.util.EwvNullsLastComparator.compare;
import static gov.va.med.ewv.util.EwvNullsLastComparator.nullsLastEwvAmbulanceInfo5010Comparator;
import static gov.va.med.ewv.util.EwvNullsLastComparator.nullsLastEwvClaimOhisComparator;
import static gov.va.med.ewv.util.EwvNullsLastComparator.nullsLastEwvServiceLineOhiAdjtmtsComparator;
import static gov.va.med.ewv.util.EwvNullsLastComparator.nullsLastEwvServiceLineOhisComparator;
import static gov.va.med.ewv.util.EwvNullsLastComparator.nullsLastEwvServiceLinesComparator;
import static gov.va.med.ewv.util.EwvNullsLastComparator.nullsLastEwvServiceLinesDrugsComparator;
import static gov.va.med.ewv.util.EwvNullsLastComparator.nullsLastEwvSlProviderComparator;
import static gov.va.med.ewv.util.EwvNullsLastComparator.nullsLastEwvSvcLineDmeComparator;
import static gov.va.med.ewv.util.EwvNullsLastComparator.nullsLastEwvSvcLineTeethComparator;
import static gov.va.med.ewv.util.EwvNullsLastComparator.nullsLastServiceLineComparator;
import static org.junit.Assert.assertTrue;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.function.BiConsumer;
import java.util.function.Supplier;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import gov.va.med.domain.ewv.EwvAmbulanceInfo5010;
import gov.va.med.domain.ewv.EwvClaimOhis;
import gov.va.med.domain.ewv.EwvServiceLineOhiAdjtmts;
import gov.va.med.domain.ewv.EwvServiceLineOhis;
import gov.va.med.domain.ewv.EwvServiceLines;
import gov.va.med.domain.ewv.EwvServiceLinesDrugs;
import gov.va.med.domain.ewv.EwvSlProvider;
import gov.va.med.domain.ewv.EwvSvcLineDme;
import gov.va.med.domain.ewv.EwvSvcLineTeeth;
/**
* @author
DNS
*
*/
final class TestCase<T, U> {
public BiConsumer<T, U> setter;
public U u0;
public U u1;
public TestCase(BiConsumer<T, U> setter, U u0, U u1)
{
super();
this.setter = setter;
this.u0 = u0;
this.u1 = u1;
}
};
public class EwvNullsLastComparatorTest {
// Check results of compare(a,b)
static void assertLT(int cmp) { assertTrue(cmp < 0); }
static void assertEQ(int cmp) { assertTrue(cmp == 0); }
static void assertGT(int cmp) { assertTrue(cmp > 0); }
// Supplier<ServiceLine> newServiceLine = ServiceLine::new; // There is no ServiceLine() here.
public static Supplier<ServiceLine> newServiceLine = () -> {
// So, provide default values for all of the members in the explicit constructor
return new ServiceLine(
null, // String // String dateOfService,
null, // String beginDateOfService,
null, // String endDateOfService,
null, // String revCode,
null, // String procedureCode,
null, // String ndcCode,
null, // String modifiers,
null, // String quantityOrType,
null, // String quantity,
null, // String type,
null, // String primaryPayerPaidAmount,
null, // List<ServiceLineOhiAdjustment> primaryOhiServiceLineAdjustments,
null, // String secondaryPayerPaidAmount,
null, // List<ServiceLineOhiAdjustment> secondaryOhiServiceLineAdjustments,
null, // String serviceTax,
null, // String facilityTax,
null, // String charge,
null, // String lineNumber,
null, // List<DrugLine> listOfDrugLines,
null, // List<ToothLine> listOfTeeth,
null, // List<MedicalEquipmentLine> listOfEquipment,
null, // String dxDtPointers,
null, // String salesTax,
null, // String operatorPhysicianNpi,
null, // String operatorPhysicianName,
null, // List<Provider> listOfProviderInfo,
null, // String pos,
null) // AmbulanceInfo serviceLineLevelAmbulanceInfo)
;
};
// Supplier<ServiceLine> newServiceLine = ServiceLine::new; // There is no ServiceLine() here.
public static Supplier<ServiceLine> newServiceLineDental = () -> {
// So, provide default values for all of the members in the explicit constructor
return new ServiceLine(
null, // String // String dateOfService,
null, // String beginDateOfService,
null, // String endDateOfService,
null, // String revCode,
null, // String procedureCode,
null, // String ndcCode,
null, // String modifiers,
null, // String quantityOrType,
null, // String quantity,
"DENTAL", // String type,
null, // String primaryPayerPaidAmount,
null, // List<ServiceLineOhiAdjustment> primaryOhiServiceLineAdjustments,
null, // String secondaryPayerPaidAmount,
null, // List<ServiceLineOhiAdjustment> secondaryOhiServiceLineAdjustments,
null, // String serviceTax,
null, // String facilityTax,
null, // String charge,
null, // String lineNumber,
null, // List<DrugLine> listOfDrugLines,
null, // List<ToothLine> listOfTeeth,
null, // List<MedicalEquipmentLine> listOfEquipment,
null, // String dxDtPointers,
null, // String salesTax,
null, // String operatorPhysicianNpi,
null, // String operatorPhysicianName,
null, // List<Provider> listOfProviderInfo,
null, // String pos,
null) // AmbulanceInfo serviceLineLevelAmbulanceInfo)
;
};
/**
* @throws java.lang.Exception
*/
@BeforeClass
public static void setUpBeforeClass() throws Exception {
}
/**
* @throws java.lang.Exception
*/
@AfterClass
public static void tearDownAfterClass() throws Exception {
}
/**
* @throws java.lang.Exception
*/
@Before
public void setUp() throws Exception {
}
/**
* @throws java.lang.Exception
*/
@After
public void tearDown() throws Exception {
}
public static <T, U, V > void test_nullsLast(
Supplier<T> newT,
TestCase<T, U> tcU,
TestCase<T, V> tcV,
Comparator<T> vs) // We assume vs and all sub-comparators are (in effect) wrapped in Comparator.nullsLast()
// that is, we compare(null, value), etc. and expect it to _NOT_ throw a NullPointerException
{
test_nullsLast(newT, tcU.setter, tcU.u0, tcU.u1, tcV.setter, tcV.u0, tcV.u1, vs);
}
// Test Comparator()
// These duplicate the compare() tests, but bypass overloading.
// public static final Comparator<ServiceLine> nullsLastServiceLineComparator =
// public static final Comparator<EwvServiceLines> nullsLastEwvServiceLinesComparator =
// public static final Comparator<EwvAmbulanceInfo5010> nullsLastEwvAmbulanceInfo5010Comparator =
// public static final Comparator<EwvServiceLineOhiAdjtmts> nullsLastEwvServiceLineOhiAdjtmtsComparator =
// public static final Comparator<EwvServiceLineOhis> nullsLastEwvServiceLineOhisComparator =
// public static final Comparator<EwvServiceLinesDrugs> nullsLastEwvServiceLinesDrugsComparator =
// public static final Comparator<EwvSlProvider> nullsLastEwvSlProviderComparator =
// public static final Comparator<EwvSvcLineDme> nullsLastEwvSvcLineDmeComparator =
// public static final Comparator<EwvSvcLineTeeth> nullsLastEwvSvcLineTeethComparator =
// public static final Comparator<EwvClaimOhis> nullsLastEwvClaimOhisComparator =
// public static final Comparator<ClaimOhiHeader> nullsLastClaimOhiHeaderComparator =
// public static final Comparator<ClaimOhiContainer> nullsLastClaimOhiContainerComparator =
// test_nullsLast tests two elements of the object being compared.
// If you are only going to test once, choose the most-significant and least-significant values
// But you can call multiple times to test over a range of values.
public static <T, U, V > void test_nullsLast_NONULL(
Supplier<T> newT,
BiConsumer<T, U> setU,
U u0, // More-significant "low" value
U u1, // More-significant "high" value
BiConsumer<T, V> setV,
V v0, // less-significant "low" value
V v1, // less-significant "high" value
Comparator<T> vs) // We assume vs and all sub-comparators are (in effect) wrapped in Comparator.nullsLast()
{
// try {
T val00 = newT.get();
T val01 = newT.get();
T val10 = newT.get();
T val11 = newT.get();
setU.accept(val00, u0);
setV.accept(val00, v0);
setU.accept(val01, u0);
setV.accept(val01, v1);
setU.accept(val10, u1);
setV.accept(val10, v0);
setU.accept(val11, u1);
setV.accept(val11, v1);
// EQ
assertEQ(vs.compare(val00, val00));
assertEQ(vs.compare(val01, val01));
assertEQ(vs.compare(val10, val10));
assertEQ(vs.compare(val11, val11));
assertEQ(vs.compare(val11, val11));
// LT
assertLT(vs.compare(val00, val01));
assertLT(vs.compare(val00, val10));
assertLT(vs.compare(val00, val11));
assertLT(vs.compare(val01, val10));
assertLT(vs.compare(val01, val11));
assertLT(vs.compare(val10, val11));
// GT
assertGT(vs.compare(val01, val00));
assertGT(vs.compare(val10, val00));
assertGT(vs.compare(val11, val00));
assertGT(vs.compare(val10, val01));
assertGT(vs.compare(val11, val01));
assertGT(vs.compare(val11, val10));
// } catch (Exception ex) {
// }
//
}
// test_nullsLast tests two elements of the object being compared.
// If you are only going to test once, choose the most-significant and least-significant values
// But you can call multiple times to test over a range of values.
public static <T, U, V > void test_nullsLast(
Supplier<T> newT,
BiConsumer<T, U> setU,
U u0, // More-significant "low" value
U u1, // More-significant "high" value
BiConsumer<T, V> setV,
V v0, // less-significant "low" value
V v1, // less-significant "high" value
Comparator<T> vs) // We assume vs and all sub-comparators are (in effect) wrapped in Comparator.nullsLast()
// that is, we compare(null, value), etc. and expect it to _NOT_ throw a NullPointerException
{
// try {
T val00 = newT.get();
T val01 = newT.get();
T val10 = newT.get();
T val11 = newT.get();
T val__ = newT.get();
T val_0 = newT.get();
T val0_ = newT.get();
T val_1 = newT.get();
T val1_ = newT.get();
T _val_ = null;
setU.accept(val00, u0);
setV.accept(val00, v0);
setU.accept(val01, u0);
setV.accept(val01, v1);
setU.accept(val10, u1);
setV.accept(val10, v0);
setU.accept(val11, u1);
setV.accept(val11, v1);
setU.accept(val__, null);
setV.accept(val__, null);
setU.accept(val_1, null);
setV.accept(val_1, v1);
setU.accept(val1_, u1);
setV.accept(val1_, null);
setU.accept(val_0, null);
setV.accept(val_0, v0);
setU.accept(val0_, u0);
setV.accept(val0_, null);
// EQ
assertEQ(vs.compare(val00, val00));
assertEQ(vs.compare(val01, val01));
assertEQ(vs.compare(val10, val10));
assertEQ(vs.compare(val11, val11));
assertEQ(vs.compare(val__, val__));
assertEQ(vs.compare(val_1, val_1));
assertEQ(vs.compare(val1_, val1_));
assertEQ(vs.compare(val11, val11));
// LT
assertLT(vs.compare(val00, val01));
assertLT(vs.compare(val00, val10));
assertLT(vs.compare(val00, val11));
assertLT(vs.compare(val01, val10));
assertLT(vs.compare(val01, val11));
assertLT(vs.compare(val10, val11));
assertLT(vs.compare(val_1, val__));
assertLT(vs.compare(val1_, val__));
assertLT(vs.compare(val11, val__));
assertLT(vs.compare(val1_, val_1));
assertLT(vs.compare(val11, val_1));
assertLT(vs.compare(val11, val1_));
assertLT(vs.compare(val_0, val__));
assertLT(vs.compare(val0_, val__));
assertLT(vs.compare(val00, val__));
assertLT(vs.compare(val0_, val_0));
assertLT(vs.compare(val00, val_0));
assertLT(vs.compare(val00, val0_));
// GT
assertGT(vs.compare(val01, val00));
assertGT(vs.compare(val10, val00));
assertGT(vs.compare(val11, val00));
assertGT(vs.compare(val10, val01));
assertGT(vs.compare(val11, val01));
assertGT(vs.compare(val11, val10));
assertGT(vs.compare(val__, val_1));
assertGT(vs.compare(val__, val1_));
assertGT(vs.compare(val__, val11));
assertGT(vs.compare(val_1, val1_));
assertGT(vs.compare(val_1, val11));
assertGT(vs.compare(val1_, val11));
assertGT(vs.compare(val__, val_0));
assertGT(vs.compare(val__, val0_));
assertGT(vs.compare(val__, val00));
assertGT(vs.compare(val_0, val0_));
assertGT(vs.compare(val_0, val00));
assertGT(vs.compare(val0_, val00));
// _val_ (null)
assertEQ(vs.compare(_val_, _val_));
assertLT(vs.compare(val00, _val_));
assertLT(vs.compare(val01, _val_));
assertLT(vs.compare(val10, _val_));
assertLT(vs.compare(val11, _val_));
assertLT(vs.compare(val__, _val_));
assertLT(vs.compare(val_1, _val_));
assertLT(vs.compare(val1_, _val_));
// assertLT(vs.compare(val11, _val_)); // dup
assertGT(vs.compare(_val_, val00));
assertGT(vs.compare(_val_, val01));
assertGT(vs.compare(_val_, val10));
assertGT(vs.compare(_val_, val11));
assertGT(vs.compare(_val_, val__));
assertGT(vs.compare(_val_, val_1));
assertGT(vs.compare(_val_, val1_));
// assertGT(vs.compare(_val_, val11)); // dup
// } catch (Exception ex) {
// fail("test_nullsLast failed with exception: " + ex.getMessage());
// }
//
}
/**
* Test method for {@link gov.va.med.ewv.util.EwvNullsLastComparator#compare(gov.va.med.ewv.util.ServiceLine, gov.va.med.ewv.util.ServiceLine)}.
*/
@Ignore
@Test
public void test_nullsLastServiceLineComparator() {
// test_nullsLastServiceLineComparator is special!
// For "DENTAL", it uses getDateOfService() instead.
// test 1, 2
test_nullsLast(
newServiceLineDental, // SPECIAL
ServiceLine::setDateOfService,
"10/25/1018", // lo date string
"01/01/2018", // hi date string
ServiceLine::setProcedureCode,
"", "]]]",
nullsLastServiceLineComparator);
// test 1, 3
test_nullsLast(
newServiceLineDental, // SPECIAL
ServiceLine::setDateOfService,
"10/25/1018", // lo date string
"01/01/2018", // hi date string
ServiceLine::setLineNumber,
"0", "23", // Line Number strings
nullsLastServiceLineComparator);
// test 2, 3
test_nullsLast(
newServiceLineDental, // SPECIAL
ServiceLine::setProcedureCode,
"", "]]]", // fake strings
ServiceLine::setLineNumber,
"0", "23", // Line Number strings
nullsLastServiceLineComparator);
// test 1, 2
test_nullsLast(
newServiceLine, // ServiceLine::new, // nope! not implemented
ServiceLine::setBeginDateOfService,
"10/25/1018", // lo date string
"01/01/2018", // hi date string
ServiceLine::setProcedureCode,
"", "]]]",
nullsLastServiceLineComparator);
// test 1, 3
test_nullsLast(
newServiceLine, // ServiceLine::new, // nope! not implemented
ServiceLine::setBeginDateOfService,
"10/25/1018", // lo date string
"01/01/2018", // hi date string
ServiceLine::setLineNumber,
"0", "23", // Line Number strings
nullsLastServiceLineComparator);
// test 2, 3
test_nullsLast(
newServiceLine, // ServiceLine::new, // nope! not implemented
ServiceLine::setProcedureCode,
"", "]]]", // fake strings
ServiceLine::setLineNumber,
"0", "23", // Line Number strings
nullsLastServiceLineComparator);
}
@Ignore
@Test
public void testNullsLastServiceLineComparator() {
test_nullsLast(
newServiceLine, // ServiceLine::new, // nope! not implemented
ServiceLine::setBeginDateOfService,
"10/25/1018", // lo date string
"01/01/2018", // hi date string
ServiceLine::setProcedureCode,
"", "]]]",
EwvNullsLastComparator::compare);
// Because we "know" that EwvNullsLastComparator::compare is implemented as a call to nullsLastServiceLineComparator.compare()
// We will rely on test_nullsLastServiceLineComparator() to be more complete.
// Here we're just testing the connection, that is, the overloading.
// So do not test all the combinations.
}
/**
* Test method for {@link gov.va.med.ewv.util.EwvNullsLastComparator#compare(gov.va.med.domain.ewv.EwvServiceLines, gov.va.med.domain.ewv.EwvServiceLines)}.
*/
@Ignore
@Test
public void test_nullsLastEwvServiceLinesComparator() {
test_nullsLast(EwvServiceLines::new,
EwvServiceLines::setBeginDateOfService,
"10/25/1018", // lo date string
"01/01/2018", // hi date string
EwvServiceLines::setProcedureCode,
"", "]]]",
nullsLastEwvServiceLinesComparator);
// NULLS are confused because test_nullsLast expects all values to be LT(u1, null)
test_nullsLast_NONULL(EwvServiceLines::new,
EwvServiceLines::setBeginDateOfService,
"10/25/1018", // lo date string
"xx ERROR xx", // hi date string, should act like a NULL
EwvServiceLines::setProcedureCode,
"", "]]]",
nullsLastEwvServiceLinesComparator);
// FAIL because of NPE in EwvServiceLines::setLineNumber.accept(null)
// test_nullsLast(EwvServiceLines::new,
// EwvServiceLines::setBeginDateOfService,
// "10/25/1018", // lo date string
// "01/01/2018", // hi date string
// EwvServiceLines::setLineNumber,
// 0L, 23L,
// nullsLastEwvServiceLinesComparator);
// test_nullsLast(EwvServiceLines::new,
// EwvServiceLines::setProcedureCode,
// "", "]]]",
// EwvServiceLines::setLineNumber,
// 0L, 23L,
// nullsLastEwvServiceLinesComparator);
//
// Avoid passing null to EwvServiceLines::setLineNumber
test_nullsLast_NONULL(EwvServiceLines::new,
EwvServiceLines::setBeginDateOfService,
"10/25/1018", // lo date string
"01/01/2018", // hi date string
EwvServiceLines::setLineNumber,
0L, 23L,
nullsLastEwvServiceLinesComparator);
test_nullsLast_NONULL(EwvServiceLines::new,
EwvServiceLines::setProcedureCode,
"", "]]]",
EwvServiceLines::setLineNumber,
0L, 23L,
nullsLastEwvServiceLinesComparator);
}
/**
* Test method for {@link gov.va.med.ewv.util.EwvNullsLastComparator#compare(gov.va.med.domain.ewv.EwvServiceLines, gov.va.med.domain.ewv.EwvServiceLines)}.
*/
@Ignore
@Test
public void testNullsLastEwvServiceLinesComparator() {
test_nullsLast(EwvServiceLines::new,
EwvServiceLines::setBeginDateOfService,
"10/25/1018", // lo date string
"01/01/2018", // hi date string
EwvServiceLines::setProcedureCode,
"", "]]]",
EwvNullsLastComparator::compare);
}
/**
* Test method for {@link gov.va.med.ewv.util.EwvNullsLastComparator#compare(gov.va.med.ewv.util.EwvAmbulanceInfo5010, gov.va.med.ewv.util.EwvAmbulanceInfo5010)}.
*/
@Test
public void test_nullsLastEwvAmbulanceInfo5010Comparator() {
EwvAmbulanceInfo5010 loVal = new EwvAmbulanceInfo5010();
EwvAmbulanceInfo5010 hiVal = new EwvAmbulanceInfo5010();
EwvAmbulanceInfo5010 __Val = new EwvAmbulanceInfo5010();
EwvAmbulanceInfo5010 noVal = null;
loVal.setPickupAddressLine1("");
loVal.setPickupAddressLine2("");
hiVal.setPickupAddressLine1("}}}");
hiVal.setPickupAddressLine2("}}}");
__Val.setPickupAddressLine1(null);
__Val.setPickupAddressLine2(null);
// Some hand-made compares
assertEQ(nullsLastEwvAmbulanceInfo5010Comparator.compare(loVal, loVal));
assertEQ(nullsLastEwvAmbulanceInfo5010Comparator.compare(hiVal, hiVal));
assertLT(nullsLastEwvAmbulanceInfo5010Comparator.compare(loVal, hiVal));
assertGT(nullsLastEwvAmbulanceInfo5010Comparator.compare(hiVal, loVal));
assertEQ(nullsLastEwvAmbulanceInfo5010Comparator.compare(noVal, noVal));
assertLT(nullsLastEwvAmbulanceInfo5010Comparator.compare(loVal, noVal));
assertLT(nullsLastEwvAmbulanceInfo5010Comparator.compare(hiVal, noVal));
assertGT(nullsLastEwvAmbulanceInfo5010Comparator.compare(noVal, loVal));
assertGT(nullsLastEwvAmbulanceInfo5010Comparator.compare(noVal, hiVal));
assertEQ(nullsLastEwvAmbulanceInfo5010Comparator.compare(__Val, __Val));
assertLT(nullsLastEwvAmbulanceInfo5010Comparator.compare(loVal, __Val));
assertLT(nullsLastEwvAmbulanceInfo5010Comparator.compare(hiVal, __Val));
assertGT(nullsLastEwvAmbulanceInfo5010Comparator.compare(__Val, loVal));
assertGT(nullsLastEwvAmbulanceInfo5010Comparator.compare(__Val, hiVal));
test_nullsLast(EwvAmbulanceInfo5010::new, // cool!
EwvAmbulanceInfo5010::setPickupAddressLine1,
"", "}}}",
EwvAmbulanceInfo5010::setPickupAddressLine2,
"", "]]]",
nullsLastEwvAmbulanceInfo5010Comparator);
// Can also be done with a Lambda function
test_nullsLast(() -> {return new EwvAmbulanceInfo5010();},
EwvAmbulanceInfo5010::setPickupAddressLine1,
"", "}}}",
EwvAmbulanceInfo5010::setPickupAddressLine2,
"", "]]]",
nullsLastEwvAmbulanceInfo5010Comparator);
// testerList.add(new TestCase<>());
BiConsumer<EwvAmbulanceInfo5010, BigDecimal> setBD = EwvAmbulanceInfo5010::setGuid;
BigDecimal u1BD = new BigDecimal(1.0);
BigDecimal u2BD = new BigDecimal(6.0e6);
TestCase<EwvAmbulanceInfo5010, BigDecimal> testBD = new TestCase<>(setBD, u1BD, u2BD);
TestCase<EwvAmbulanceInfo5010, BigDecimal> testBD2 = new TestCase<>(EwvAmbulanceInfo5010::setGuid, new BigDecimal(1.0), new BigDecimal(6.0e6));
List<TestCase<EwvAmbulanceInfo5010, String>> testerList = new ArrayList<TestCase<EwvAmbulanceInfo5010, String>>(0);
testerList.add(new TestCase<>(EwvAmbulanceInfo5010::setPickupAddressLine1, "", "zzz"));
testerList.add(new TestCase<>(EwvAmbulanceInfo5010::setPickupAddressLine2, "", "zzz"));
testerList.add(new TestCase<>(EwvAmbulanceInfo5010::setPickupCity, "", "zzz"));
testerList.add(new TestCase<>(EwvAmbulanceInfo5010::setPickupState, "", "zzz"));
testerList.add(new TestCase<>(EwvAmbulanceInfo5010::setPickupZip, "", "zzz"));
testerList.add(new TestCase<>(EwvAmbulanceInfo5010::setDropoffAddressLine1, "", "zzz"));
testerList.add(new TestCase<>(EwvAmbulanceInfo5010::setDropoffAddressLine2, "", "zzz"));
testerList.add(new TestCase<>(EwvAmbulanceInfo5010::setDropoffCity, "", "zzz"));
testerList.add(new TestCase<>(EwvAmbulanceInfo5010::setDropoffState, "", "zzz"));
testerList.add(new TestCase<>(EwvAmbulanceInfo5010::setDropoffZip, "", "zzz"));
testerList.add(new TestCase<>(EwvAmbulanceInfo5010::setTransportReasonCode, "", "zzz"));
testerList.add(new TestCase<>(EwvAmbulanceInfo5010::setTransportDistance, "", "zzz"));
testerList.add(new TestCase<>(EwvAmbulanceInfo5010::setRoundTripPurpose, "", "zzz"));
testerList.add(new TestCase<>(EwvAmbulanceInfo5010::setStretcherPurpose, "", "zzz"));
testerList.add(new TestCase<>(EwvAmbulanceInfo5010::setCertIndicator1, "", "zzz"));
testerList.add(new TestCase<>(EwvAmbulanceInfo5010::setConditionCode11, "", "zzz"));
testerList.add(new TestCase<>(EwvAmbulanceInfo5010::setConditionCode12, "", "zzz"));
testerList.add(new TestCase<>(EwvAmbulanceInfo5010::setConditionCode13, "", "zzz"));
testerList.add(new TestCase<>(EwvAmbulanceInfo5010::setConditionCode14, "", "zzz"));
testerList.add(new TestCase<>(EwvAmbulanceInfo5010::setConditionCode15, "", "zzz"));
testerList.add(new TestCase<>(EwvAmbulanceInfo5010::setCertIndicator2, "", "zzz"));
testerList.add(new TestCase<>(EwvAmbulanceInfo5010::setConditionCode21, "", "zzz"));
testerList.add(new TestCase<>(EwvAmbulanceInfo5010::setConditionCode22, "", "zzz"));
testerList.add(new TestCase<>(EwvAmbulanceInfo5010::setConditionCode23, "", "zzz"));
testerList.add(new TestCase<>(EwvAmbulanceInfo5010::setConditionCode24, "", "zzz"));
testerList.add(new TestCase<>(EwvAmbulanceInfo5010::setConditionCode25, "", "zzz"));
testerList.add(new TestCase<>(EwvAmbulanceInfo5010::setCertIndicator3, "", "zzz"));
testerList.add(new TestCase<>(EwvAmbulanceInfo5010::setConditionCode31, "", "zzz"));
testerList.add(new TestCase<>(EwvAmbulanceInfo5010::setConditionCode32, "", "zzz"));
testerList.add(new TestCase<>(EwvAmbulanceInfo5010::setConditionCode33, "", "zzz"));
testerList.add(new TestCase<>(EwvAmbulanceInfo5010::setConditionCode34, "", "zzz"));
testerList.add(new TestCase<>(EwvAmbulanceInfo5010::setConditionCode35, "", "zzz"));
for (int i = 0; i < testerList.size(); ++i) {
TestCase<EwvAmbulanceInfo5010, String> testCaseI = testerList.get(i);
for (int j = i+1; j < testerList.size(); ++j) {
TestCase<EwvAmbulanceInfo5010, String> testCaseJ = testerList.get(j);
test_nullsLast(EwvAmbulanceInfo5010::new,
testCaseI,
testCaseJ,
nullsLastEwvAmbulanceInfo5010Comparator);
}
// The last one is different!
test_nullsLast(EwvAmbulanceInfo5010::new,
testCaseI,
testBD,
nullsLastEwvAmbulanceInfo5010Comparator);
}
}
/**
* Test method for {@link gov.va.med.ewv.util.EwvNullsLastComparator#compare(gov.va.med.ewv.util.EwvAmbulanceInfo5010, gov.va.med.ewv.util.EwvAmbulanceInfo5010)}.
*/
@Test
public void testNullsLastEwvAmbulanceInfo5010Comparator() {
EwvAmbulanceInfo5010 loVal = new EwvAmbulanceInfo5010();
EwvAmbulanceInfo5010 hiVal = new EwvAmbulanceInfo5010();
EwvAmbulanceInfo5010 __Val = new EwvAmbulanceInfo5010();
EwvAmbulanceInfo5010 noVal = null;
// The MS part is low, but the LS part is high
loVal.setPickupAddressLine1("");
loVal.setPickupAddressLine2("}}}");
// The MS part is high, but the LS part is low
hiVal.setPickupAddressLine1("}}}");
hiVal.setPickupAddressLine2("");
__Val.setPickupAddressLine1(null);
__Val.setPickupAddressLine2(null);
// Some hand-made compares
assertEQ(compare(loVal, loVal));
assertEQ(compare(hiVal, hiVal));
assertLT(compare(loVal, hiVal));
assertGT(compare(hiVal, loVal));
assertEQ(compare(noVal, noVal));
assertLT(compare(loVal, noVal));
assertLT(compare(hiVal, noVal));
assertGT(compare(noVal, loVal));
assertGT(compare(noVal, hiVal));
assertEQ(compare(__Val, __Val));
assertLT(compare(loVal, __Val));
assertLT(compare(hiVal, __Val));
assertGT(compare(__Val, loVal));
assertGT(compare(__Val, hiVal));
test_nullsLast(EwvAmbulanceInfo5010::new, // cool!
EwvAmbulanceInfo5010::setPickupAddressLine1,
"", "}}}",
EwvAmbulanceInfo5010::setPickupAddressLine2,
"", "]]]",
EwvNullsLastComparator::compare);
// Can also be done with a Lambda function
test_nullsLast(() -> {return new EwvAmbulanceInfo5010();},
EwvAmbulanceInfo5010::setPickupAddressLine1,
"", "}}}",
EwvAmbulanceInfo5010::setPickupAddressLine2,
"", "]]]",
EwvNullsLastComparator::compare);
}
/**
* Test method for {@link gov.va.med.ewv.util.EwvNullsLastComparator#compare(gov.va.med.ewv.util.ServiceLine, gov.va.med.ewv.util.ServiceLine)}.
*/
@Test
public void test_nullsLastEwvServiceLineOhiAdjtmtsComparator() {
test_nullsLast(EwvServiceLineOhiAdjtmts::new, // cool!
EwvServiceLineOhiAdjtmts::setPrimaryPayerId,
"", "}}}",
EwvServiceLineOhiAdjtmts::setSvcLineAdjustmtReasonCode,
"", "]]]",
nullsLastEwvServiceLineOhiAdjtmtsComparator);
}
/**
* Test method for {@link gov.va.med.ewv.util.EwvNullsLastComparator#compare(gov.va.med.ewv.util.ServiceLine, gov.va.med.ewv.util.ServiceLine)}.
*/
@Test
public void testNullsLastEwvServiceLineOhiAdjtmtsComparator() {
test_nullsLast(EwvServiceLineOhiAdjtmts::new, // cool!
EwvServiceLineOhiAdjtmts::setPrimaryPayerId,
"", "}}}",
EwvServiceLineOhiAdjtmts::setSvcLineAdjustmtReasonCode,
"", "]]]",
EwvNullsLastComparator::compare);
}
/**
* Test method for {@link gov.va.med.ewv.util.EwvNullsLastComparator#compare(gov.va.med.ewv.util.ServiceLine, gov.va.med.ewv.util.ServiceLine)}.
*/
@Test
public void test_nullsLastEwvServiceLineOhisComparator() {
test_nullsLast(EwvServiceLineOhis::new,
EwvServiceLineOhis::setOhiAdjudicatedDate,
"10/25/1018", // lo date string
"01/01/2018", // hi date string
EwvServiceLineOhis::setProcedureCode,
"", "]]]",
nullsLastEwvServiceLineOhisComparator);
}
/**
* Test method for {@link gov.va.med.ewv.util.EwvNullsLastComparator#compare(gov.va.med.ewv.util.ServiceLine, gov.va.med.ewv.util.ServiceLine)}.
*/
@Test
public void testNullsLastEwvServiceLineOhisComparator() {
test_nullsLast(EwvServiceLineOhis::new,
EwvServiceLineOhis::setOhiAdjudicatedDate,
"10/25/1018", // lo date string
"01/01/2018", // hi date string
EwvServiceLineOhis::setProcedureCode,
"", "]]]",
EwvNullsLastComparator::compare);
}
/**
* Test method for {nullsLastEwvServiceLineOhisComparatorlink gov.va.med.ewv.util.EwvNullsLastComparator#compare(gov.va.med.ewv.util.ServiceLine, gov.va.med.ewv.util.ServiceLine)}.
*/
public void test_nullsLastEwvServiceLinesDrugsComparator() {
test_nullsLast(EwvServiceLinesDrugs::new,
EwvServiceLinesDrugs::setDrugRx,
"", "}}}",
EwvServiceLinesDrugs::setDrugRxNdcCode,
"", "]]]",
nullsLastEwvServiceLinesDrugsComparator);
}
/**
* Test method for {nullsLastEwvServiceLineOhisComparatorlink gov.va.med.ewv.util.EwvNullsLastComparator#compare(gov.va.med.ewv.util.ServiceLine, gov.va.med.ewv.util.ServiceLine)}.
*/
public void testNullsLastEwvServiceLinesDrugsComparator() {
test_nullsLast(EwvServiceLinesDrugs::new,
EwvServiceLinesDrugs::setDrugRx,
"", "}}}",
EwvServiceLinesDrugs::setDrugRxNdcCode,
"", "]]]",
EwvNullsLastComparator::compare);
}
/**
* Test method for {@link gov.va.med.ewv.util.EwvNullsLastComparator#compare(gov.va.med.ewv.util.ServiceLine, gov.va.med.ewv.util.ServiceLine)}.
*/
@Test
public void test_nullsLastEwvSlProviderComparator() {
test_nullsLast(EwvSlProvider::new,
EwvSlProvider::setProviderType,
"", "}}}",
EwvSlProvider::setProviderId,
"", "]]]",
nullsLastEwvSlProviderComparator);
}
/**
* Test method for {@link gov.va.med.ewv.util.EwvNullsLastComparator#compare(gov.va.med.ewv.util.ServiceLine, gov.va.med.ewv.util.ServiceLine)}.
*/
@Test
public void testNullsLastEwvSlProviderComparator() {
test_nullsLast(EwvSlProvider::new,
EwvSlProvider::setProviderType,
"", "}}}",
EwvSlProvider::setProviderId,
"", "]]]",
EwvNullsLastComparator::compare);
}
/**
* Test method for {@link gov.va.med.ewv.util.EwvNullsLastComparator#compare(gov.va.med.ewv.util.ServiceLine, gov.va.med.ewv.util.ServiceLine)}.
*/
@Test
public void test_nullsLastEwvSvcLineDmeComparator() {
test_nullsLast(EwvSvcLineDme::new,
EwvSvcLineDme::setDmeLengthMedicalNecessity,
"", "}}}",
EwvSvcLineDme::setDmeFrequency,
"", "]]]",
nullsLastEwvSvcLineDmeComparator);
}
/**
* Test method for {@link gov.va.med.ewv.util.EwvNullsLastComparator#compare(gov.va.med.ewv.util.ServiceLine, gov.va.med.ewv.util.ServiceLine)}.
*/
@Test
public void testNullsLastEwvSvcLineDmeComparator() {
test_nullsLast(EwvSvcLineDme::new,
EwvSvcLineDme::setDmeLengthMedicalNecessity,
"", "}}}",
EwvSvcLineDme::setDmeFrequency,
"", "]]]",
EwvNullsLastComparator::compare);
}
/**
* Test method for {@link gov.va.med.ewv.util.EwvNullsLastComparator#compare(gov.va.med.ewv.util.ServiceLine, gov.va.med.ewv.util.ServiceLine)}.
*/
@Test
public void test_nullsLastEwvSvcLineTeethComparator() {
test_nullsLast(EwvSvcLineTeeth::new,
EwvSvcLineTeeth::setToothNumber,
"", "}}}",
EwvSvcLineTeeth::setSurface1,
"", "]]]",
nullsLastEwvSvcLineTeethComparator);
}
/**
* Test method for {@link gov.va.med.ewv.util.EwvNullsLastComparator#compare(gov.va.med.ewv.util.ServiceLine, gov.va.med.ewv.util.ServiceLine)}.
*/
@Test
public void testNullsLastEwvSvcLineTeethComparator() {
test_nullsLast(EwvSvcLineTeeth::new,
EwvSvcLineTeeth::setToothNumber,
"", "}}}",
EwvSvcLineTeeth::setSurface1,
"", "]]]",
nullsLastEwvSvcLineTeethComparator);
}
/**
* Test method for {@link gov.va.med.ewv.util.EwvNullsLastComparator#compare(gov.va.med.ewv.util.ServiceLine, gov.va.med.ewv.util.ServiceLine)}.
*/
@Test
public void test_nullsLastEwvClaimOhisComparator() {
test_nullsLast(EwvClaimOhis::new,
EwvClaimOhis::setPaymentSequenceIndicator,
"", "}}}",
EwvClaimOhis::setClaimAdjustmentDate,
"10/25/1018", // lo date string
"01/01/2018", // hi date string
nullsLastEwvClaimOhisComparator);
}
/**
* Test method for {@link gov.va.med.ewv.util.EwvNullsLastComparator#compare(gov.va.med.ewv.util.ServiceLine, gov.va.med.ewv.util.ServiceLine)}.
*/
@Test
public void testNullsLastEwvClaimOhisComparator() {
test_nullsLast(EwvClaimOhis::new,
EwvClaimOhis::setPaymentSequenceIndicator,
"", "}}}",
EwvClaimOhis::setClaimAdjustmentDate,
"10/25/1018", // lo date string
"01/01/2018", // hi date string
EwvNullsLastComparator::compare);
}
// /**
// * Test method for {@link gov.va.med.ewv.util.EwvNullsLastComparator#compare(gov.va.med.ewv.util.ServiceLine, gov.va.med.ewv.util.ServiceLine)}.
// */
// @Test
// public void test_nullsLastClaimOhiHeaderComparator() {
// test_nullsLast(ClaimOhiHeader::new,
// ClaimOhiHeader::setPaymentSequenceIndicator,
// "", "}}}",
// ClaimOhiHeader::setOhiGroupName,
// "", "]]]",
// nullsLastClaimOhiHeaderComparator);
// }
// There is no applicable set2
// /**
// * Test method for {@link gov.va.med.ewv.util.EwvNullsLastComparator#compare(gov.va.med.ewv.util.ServiceLine, gov.va.med.ewv.util.ServiceLine)}.
// */
// @Test
// public void test_nullsLastClaimOhiContainerComparator() {
// test_nullsLast(ClaimOhiContainer::new,
// ClaimOhiContainer::getClaimOhiHeaderBean,
// "", "}}}",
// ClaimOhiContainer::set2,
// "", "]]]",
// nullsLastClaimOhiContainerComparator);
//
// }
}