use of org.apache.flink.api.connector.sink2.mocks.MockCommitRequest in project flink by apache.
the class FileCommitterTest method testCommitPendingFile.
@Test
public void testCommitPendingFile() throws Exception {
StubBucketWriter stubBucketWriter = new StubBucketWriter();
FileCommitter fileCommitter = new FileCommitter(stubBucketWriter);
MockCommitRequest<FileSinkCommittable> fileSinkCommittable = new MockCommitRequest<>(new FileSinkCommittable("0", new FileSinkTestUtils.TestPendingFileRecoverable()));
fileCommitter.commit(Collections.singletonList(fileSinkCommittable));
assertEquals(1, stubBucketWriter.getRecoveredPendingFiles().size());
assertEquals(0, stubBucketWriter.getNumCleanUp());
assertTrue(stubBucketWriter.getRecoveredPendingFiles().get(0).isCommitted());
assertEquals(0, fileSinkCommittable.getNumberOfRetries());
}
Aggregations