Skip to content

Commit 1abb575

Browse files
committed
Cleanup
1 parent 158cfdb commit 1abb575

File tree

1 file changed

+7
-30
lines changed

1 file changed

+7
-30
lines changed

src/test/java/com/imsweb/seerapi/compare/ComparisonTest.java

+7-30
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ void testNdc() throws IOException {
5252
NdcService localService = new SeerApi.Builder().url(LOCAL_URL).apiKey(getApiKey()).connect().ndc();
5353

5454
long page = 1;
55+
long processed = 0;
5556

5657
Map<String, String> params = new HashMap<>();
5758
params.put("page", String.valueOf(page));
@@ -61,12 +62,13 @@ void testNdc() throws IOException {
6162
List<NdcProduct> localList = localService.search(params).execute().body();
6263

6364
while (!Objects.requireNonNull(prodList).isEmpty() && !Objects.requireNonNull(localList).isEmpty()) {
65+
processed += prodList.size();
6466
assertThat(localList)
6567
.hasSameSizeAs(prodList) // Ensure both lists have the same size
6668
.usingRecursiveComparison()
6769
.isEqualTo(prodList);
6870

69-
System.out.println("NDC page " + page);
71+
System.out.println("NDC page " + page + " (processed " + processed + " so far)");
7072

7173
page += 1;
7274
params.put("page", String.valueOf(page));
@@ -80,6 +82,7 @@ void testHcpcs() throws IOException {
8082
HcpcsService prodService = new SeerApi.Builder().url(PROD_URL).apiKey(getApiKey()).connect().hcpcs();
8183
HcpcsService localService = new SeerApi.Builder().url(LOCAL_URL).apiKey(getApiKey()).connect().hcpcs();
8284

85+
long processed = 0;
8386
long page = 1;
8487

8588
Map<String, String> params = new HashMap<>();
@@ -91,7 +94,9 @@ void testHcpcs() throws IOException {
9194
List<Hcpcs> localList = localService.search(params).execute().body();
9295

9396
while (!Objects.requireNonNull(prodList).isEmpty()) {
94-
System.out.println("HCPCS page " + page);
97+
processed += prodList.size();
98+
System.out.println("HCPCS page " + page + " (processed " + processed + " so far)");
99+
95100
assertThat(localList)
96101
.hasSameSizeAs(prodList) // Ensure both lists have the same size
97102
.usingRecursiveComparison()
@@ -239,20 +244,6 @@ void testGlossary() throws IOException {
239244

240245
assertThat(localGlossary)
241246
.usingRecursiveComparison()
242-
.withComparatorForType(
243-
(value1, value2) -> {
244-
// Treat null and empty string as equal
245-
if (value1 == null && "".equals(value2) || "".equals(value1) && value2 == null) {
246-
return 0; // Consider them equal
247-
}
248-
if (value1 == null)
249-
return -1;
250-
if (value2 == null)
251-
return 1;
252-
return value1.compareTo(value2);
253-
},
254-
String.class // Apply to all String fields, including in lists
255-
)
256247
.isEqualTo(prodGlossary);
257248
}
258249
}
@@ -337,20 +328,6 @@ void testDisease() throws IOException {
337328

338329
assertThat(localDisease)
339330
.usingRecursiveComparison()
340-
.withComparatorForType(
341-
(value1, value2) -> {
342-
// Treat null and empty string as equal
343-
if (value1 == null && "".equals(value2) || "".equals(value1) && value2 == null) {
344-
return 0; // Consider them equal
345-
}
346-
if (value1 == null)
347-
return -1;
348-
if (value2 == null)
349-
return 1;
350-
return value1.compareTo(value2);
351-
},
352-
String.class // Apply to all String fields, including in lists
353-
)
354331
.isEqualTo(prodDisease);
355332
}
356333
}

0 commit comments

Comments
 (0)