diff --git a/hollow/src/test/java/com/netflix/hollow/core/read/engine/list/HollowListTypeDataElementsSplitJoinTest.java b/hollow/src/test/java/com/netflix/hollow/core/read/engine/list/HollowListTypeDataElementsSplitJoinTest.java index 610e95915..424c801dd 100644 --- a/hollow/src/test/java/com/netflix/hollow/core/read/engine/list/HollowListTypeDataElementsSplitJoinTest.java +++ b/hollow/src/test/java/com/netflix/hollow/core/read/engine/list/HollowListTypeDataElementsSplitJoinTest.java @@ -19,7 +19,7 @@ public void testSplitThenJoin() throws IOException { int maxNumListRecords = 100; // 1->2->1, 1->4->1, ... - for (int numRecords=0;numRecords new IllegalArgumentException("Array is empty")); - // populate write state with that many ordinals - super.populateWriteStateEngine(numKeyValueOrdinals); + if (maps.length > 0) { + int numKeyValueOrdinals = 1 + Arrays.stream(maps) + .flatMap(Arrays::stream) + .flatMapToInt(Arrays::stream) + .max() + .orElseThrow(() -> new IllegalArgumentException("Array is empty")); + // populate write state with that many ordinals + super.populateWriteStateEngine(numKeyValueOrdinals); + } for(int[][] map : maps) { HollowMapWriteRecord rec = new HollowMapWriteRecord(); for (int[] entry : map) { @@ -65,6 +68,21 @@ protected HollowMapTypeReadState populateTypeStateWith(int[][][] maps) throws IO return (HollowMapTypeReadState) readStateEngine.getTypeState("TestMap"); } + protected int[][][] generateListContents(int numRecords) { + int[][][] maps = new int[numRecords][][]; + Random random = new Random(); + int maxEntries = 10; + for (int i=0;i2->1, 1->4->1, ... - for (int listRecord=0;listRecord