Skip to content

Commit

Permalink
Test that the result is empty when nothing is processed (#543)
Browse files Browse the repository at this point in the history
Test fails because it's a line break inserted although there was
no data processed.
  • Loading branch information
dr0i committed Sep 27, 2024
1 parent 04a6312 commit a6a7fa8
Showing 1 changed file with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeFalse;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.metafacture.commons.ResourceUtil;

import java.io.File;
import java.io.FileInputStream;
Expand All @@ -28,12 +33,6 @@
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;

import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.metafacture.commons.ResourceUtil;

/**
* Tests for class {@link ObjectFileWriter}.
*
Expand Down Expand Up @@ -105,6 +104,14 @@ public void shouldIncrementCountOnResetBeforeStartingNewFile() throws IOExceptio
assertTrue(new File(tempFolder.getRoot(), "test-1").exists());
}

@Test
public void issue543_shouldResultEmptyWhenNothingIsProcessed() throws IOException {
writer.process("");
writer.closeStream();

assertOutput( "");
}

@Override
protected ConfigurableObjectWriter<String> getWriter() {
return writer;
Expand Down

0 comments on commit a6a7fa8

Please sign in to comment.