Source:
public void testAbfsOutputStreamUploadingBytes() throws IOException { describe("Testing Bytes uploaded successfully in AbfsOutputSteam"); final AzureBlobFileSystem fs = getFileSystem(); Path uploadBytesFilePath = path(getMethodName()); String testBytesToUpload = "bytes"; try ( AbfsOutputStream outForSomeBytes = createAbfsOutputStreamWithFlushEnabled( fs, uploadBytesFilePath) ) { AbfsOutputStreamStatisticsImpl abfsOutputStreamStatisticsForUploadBytes = outForSomeBytes.getOutputStreamStatistics(); assertValues("bytes to upload", 0, abfsOutputStreamStatisticsForUploadBytes.getBytesToUpload()); outForSomeBytes.write(testBytesToUpload.getBytes()); outForSomeBytes.flush(); abfsOutputStreamStatisticsForUploadBytes = outForSomeBytes.getOutputStreamStatistics(); assertValues("bytes to upload", testBytesToUpload.getBytes().length, abfsOutputStreamStatisticsForUploadBytes.getBytesToUpload()); assertValues("successful bytes uploaded", testBytesToUpload.getBytes().length, abfsOutputStreamStatisticsForUploadBytes.getBytesUploadSuccessful()); } try ( AbfsOutputStream outForLargeBytes = createAbfsOutputStreamWithFlushEnabled( fs, uploadBytesFilePath)) { for (int i = 0; i < LARGE_OPERATIONS; i++) { outForLargeBytes.write(testBytesToUpload.getBytes()); } outForLargeBytes.flush(); AbfsOutputStreamStatisticsImpl abfsOutputStreamStatistics = outForLargeBytes.getOutputStreamStatistics(); assertValues("bytes to upload", LARGE_OPERATIONS * (testBytesToUpload.getBytes().length), abfsOutputStreamStatistics.getBytesToUpload()); assertValues("successful bytes uploaded", LARGE_OPERATIONS * (testBytesToUpload.getBytes().length), abfsOutputStreamStatistics.getBytesUploadSuccessful()); } }

Target:
public void testAbfsOutputStreamUploadingBytes() throws IOException { describe("Testing bytes uploaded successfully by AbfsOutputSteam"); final AzureBlobFileSystem fs = getFileSystem(); Path uploadBytesFilePath = path(getMethodName()); String testBytesToUpload = "bytes"; try ( AbfsOutputStream outForSomeBytes = createAbfsOutputStreamWithFlushEnabled( fs, uploadBytesFilePath) ) { AbfsOutputStreamStatisticsImpl abfsOutputStreamStatisticsForUploadBytes = getAbfsOutputStreamStatistics(outForSomeBytes); assertEquals("Mismatch in bytes to upload", 0, abfsOutputStreamStatisticsForUploadBytes.getBytesToUpload()); outForSomeBytes.write(testBytesToUpload.getBytes()); outForSomeBytes.flush(); abfsOutputStreamStatisticsForUploadBytes = getAbfsOutputStreamStatistics(outForSomeBytes); assertEquals("Mismatch in bytes to upload", testBytesToUpload.getBytes().length, abfsOutputStreamStatisticsForUploadBytes.getBytesToUpload()); assertEquals("Mismatch in successful bytes uploaded", testBytesToUpload.getBytes().length, abfsOutputStreamStatisticsForUploadBytes.getBytesUploadSuccessful()); } try ( AbfsOutputStream outForLargeBytes = createAbfsOutputStreamWithFlushEnabled( fs, uploadBytesFilePath)) { for (int i = 0; i < OPERATIONS; i++) { outForLargeBytes.write(testBytesToUpload.getBytes()); } outForLargeBytes.flush(); AbfsOutputStreamStatisticsImpl abfsOutputStreamStatistics = getAbfsOutputStreamStatistics(outForLargeBytes); assertEquals("Mismatch in bytes to upload", OPERATIONS * (testBytesToUpload.getBytes().length), abfsOutputStreamStatistics.getBytesToUpload()); assertEquals("Mismatch in successful bytes uploaded", OPERATIONS * (testBytesToUpload.getBytes().length), abfsOutputStreamStatistics.getBytesUploadSuccessful()); } }