Skip to content

Commit d9b92ab

Browse files
committed
Cleanup style of test
1 parent 439ea52 commit d9b92ab

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

fdb-record-layer-core/src/test/java/com/apple/foundationdb/record/provider/foundationdb/keyspace/KeySpacePathDataExportTest.java

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
import java.util.Set;
4949
import java.util.UUID;
5050
import java.util.concurrent.atomic.AtomicReference;
51+
import java.util.stream.Collectors;
5152
import java.util.stream.IntStream;
5253

5354
import static org.assertj.core.api.Assertions.assertThat;
@@ -240,14 +241,9 @@ void testExportAllDataWithDifferentKeyTypes() {
240241
assertEquals(12, allData.size());
241242

242243
// 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());
251247
assertEquals(5, valueTypes.size());
252248
assertTrue(valueTypes.containsAll(Arrays.asList("string", "long", "bytes", "uuid", "boolean")));
253249
}
@@ -353,7 +349,7 @@ void testExportAllDataWithDeepNestedStructure() {
353349
KeySpacePath orgPath = root.path("org");
354350
final List<KeyValue> allData = exportAllData(orgPath, context);
355351

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)
357353
assertEquals(16, allData.size());
358354
}
359355

@@ -411,8 +407,7 @@ void testExportAllDataWithBinaryData() {
411407
assertEquals(3, allData.size());
412408

413409
// Verify binary data integrity
414-
for (int i = 0; i < allData.size(); i++) {
415-
KeyValue kv = allData.get(i);
410+
for (KeyValue kv : allData) {
416411
String valueStr = new String(kv.getValue());
417412
assertTrue(valueStr.startsWith("binary_data_"));
418413
}

0 commit comments

Comments
 (0)