@@ -52,6 +52,7 @@ void testNdc() throws IOException {
52
52
NdcService localService = new SeerApi .Builder ().url (LOCAL_URL ).apiKey (getApiKey ()).connect ().ndc ();
53
53
54
54
long page = 1 ;
55
+ long processed = 0 ;
55
56
56
57
Map <String , String > params = new HashMap <>();
57
58
params .put ("page" , String .valueOf (page ));
@@ -61,12 +62,13 @@ void testNdc() throws IOException {
61
62
List <NdcProduct > localList = localService .search (params ).execute ().body ();
62
63
63
64
while (!Objects .requireNonNull (prodList ).isEmpty () && !Objects .requireNonNull (localList ).isEmpty ()) {
65
+ processed += prodList .size ();
64
66
assertThat (localList )
65
67
.hasSameSizeAs (prodList ) // Ensure both lists have the same size
66
68
.usingRecursiveComparison ()
67
69
.isEqualTo (prodList );
68
70
69
- System .out .println ("NDC page " + page );
71
+ System .out .println ("NDC page " + page + " (processed " + processed + " so far)" );
70
72
71
73
page += 1 ;
72
74
params .put ("page" , String .valueOf (page ));
@@ -80,6 +82,7 @@ void testHcpcs() throws IOException {
80
82
HcpcsService prodService = new SeerApi .Builder ().url (PROD_URL ).apiKey (getApiKey ()).connect ().hcpcs ();
81
83
HcpcsService localService = new SeerApi .Builder ().url (LOCAL_URL ).apiKey (getApiKey ()).connect ().hcpcs ();
82
84
85
+ long processed = 0 ;
83
86
long page = 1 ;
84
87
85
88
Map <String , String > params = new HashMap <>();
@@ -91,7 +94,9 @@ void testHcpcs() throws IOException {
91
94
List <Hcpcs > localList = localService .search (params ).execute ().body ();
92
95
93
96
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
+
95
100
assertThat (localList )
96
101
.hasSameSizeAs (prodList ) // Ensure both lists have the same size
97
102
.usingRecursiveComparison ()
@@ -239,20 +244,6 @@ void testGlossary() throws IOException {
239
244
240
245
assertThat (localGlossary )
241
246
.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
- )
256
247
.isEqualTo (prodGlossary );
257
248
}
258
249
}
@@ -337,20 +328,6 @@ void testDisease() throws IOException {
337
328
338
329
assertThat (localDisease )
339
330
.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
- )
354
331
.isEqualTo (prodDisease );
355
332
}
356
333
}
0 commit comments