Skip to content

Commit

Permalink
pdf.Stream.getFilters() result is unmodifiable.
Browse files Browse the repository at this point in the history
  • Loading branch information
eseifert committed Aug 19, 2017
1 parent 5d1694d commit ff38218
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import static org.junit.Assert.assertThat; import static org.junit.Assert.assertThat;


import java.io.IOException; import java.io.IOException;
import java.util.List;
import java.util.zip.DataFormatException; import java.util.zip.DataFormatException;
import java.util.zip.Inflater; import java.util.zip.Inflater;
import org.junit.Test; import org.junit.Test;
Expand Down Expand Up @@ -130,4 +131,12 @@ public void contentsAreCompressedWhenFlateFilterIsSet() throws DataFormatExcepti
decompressor.inflate(decompressedOutput); decompressor.inflate(decompressedOutput);
assertThat(decompressedOutput, is(inputData)); assertThat(decompressedOutput, is(inputData));
} }

@Test(expected = UnsupportedOperationException.class)
public void getFiltersResultIsUnmodifiable() {
Stream stream = new Stream();

List<Stream.Filter> filters = stream.getFilters();
filters.add(Stream.Filter.FLATE);
}
} }

0 comments on commit ff38218

Please sign in to comment.