|
48 | 48 | import java.util.Set; |
49 | 49 | import java.util.UUID; |
50 | 50 | import java.util.concurrent.atomic.AtomicReference; |
| 51 | +import java.util.stream.Collectors; |
51 | 52 | import java.util.stream.IntStream; |
52 | 53 |
|
53 | 54 | import static org.assertj.core.api.Assertions.assertThat; |
@@ -240,14 +241,9 @@ void testExportAllDataWithDifferentKeyTypes() { |
240 | 241 | assertEquals(12, allData.size()); |
241 | 242 |
|
242 | 243 | // Verify we have different value types |
243 | | - List<String> valueTypes = new ArrayList<>(); |
244 | | - for (KeyValue kv : allData) { |
245 | | - String value = Tuple.fromBytes(kv.getValue()).getString(0); |
246 | | - String valueType = value.split("_")[0]; |
247 | | - if (!valueTypes.contains(valueType)) { |
248 | | - valueTypes.add(valueType); |
249 | | - } |
250 | | - } |
| 244 | + Set<String> valueTypes = allData.stream() |
| 245 | + .map(kv -> Tuple.fromBytes(kv.getValue()).getString(0).split("_")[0]) |
| 246 | + .collect(Collectors.toSet()); |
251 | 247 | assertEquals(5, valueTypes.size()); |
252 | 248 | assertTrue(valueTypes.containsAll(Arrays.asList("string", "long", "bytes", "uuid", "boolean"))); |
253 | 249 | } |
@@ -353,7 +349,7 @@ void testExportAllDataWithDeepNestedStructure() { |
353 | 349 | KeySpacePath orgPath = root.path("org"); |
354 | 350 | final List<KeyValue> allData = exportAllData(orgPath, context); |
355 | 351 |
|
356 | | - // Should have 16 records (2 depts * 2 teams * 2 members * 2 records each) |
| 352 | + // Should have 16 records (2 departments * 2 teams * 2 members * 2 records each) |
357 | 353 | assertEquals(16, allData.size()); |
358 | 354 | } |
359 | 355 |
|
@@ -411,8 +407,7 @@ void testExportAllDataWithBinaryData() { |
411 | 407 | assertEquals(3, allData.size()); |
412 | 408 |
|
413 | 409 | // Verify binary data integrity |
414 | | - for (int i = 0; i < allData.size(); i++) { |
415 | | - KeyValue kv = allData.get(i); |
| 410 | + for (KeyValue kv : allData) { |
416 | 411 | String valueStr = new String(kv.getValue()); |
417 | 412 | assertTrue(valueStr.startsWith("binary_data_")); |
418 | 413 | } |
|
0 commit comments