zhoulii commented on code in PR #19946: URL: https://github.com/apache/flink/pull/19946#discussion_r896417184
########## flink-core/src/test/java/org/apache/flink/api/common/io/BinaryInputFormatTest.java: ########## @@ -160,11 +161,45 @@ public void testGetStatisticsMultiplePaths() throws IOException { stats.getTotalInputSize()); } + @Test + public void testCreateInputSplitsWithEmptySplit() throws IOException { + final int blockInfoSize = new BlockInfo().getInfoSize(); + final int blockSize = blockInfoSize + 8; + final int numBlocks = 3; + final int minNumSplits = 5; + + // create temporary file with 3 blocks + final File tempFile = + createBinaryInputFile( + "test_create_input_splits_with_empty_split", blockSize, numBlocks); + + final Configuration config = new Configuration(); + config.setLong("input.block_size", blockSize + 10); + + final BinaryInputFormat<Record> inputFormat = new MyBinaryInputFormat(); + inputFormat.setFilePath(tempFile.toURI().toString()); + inputFormat.setBlockSize(blockSize); + + inputFormat.configure(config); + + FileInputSplit[] inputSplits = inputFormat.createInputSplits(minNumSplits); + + Assert.assertEquals( Review Comment: Thanks for reviewing, the suggestion is very helpful. I have reworked BinaryInputFormatTest to be based on AssertJ, can you take a look when you are free? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org