diff options
author | Dominik Stadler <centic@apache.org> | 2021-11-07 14:59:40 +0000 |
---|---|---|
committer | Dominik Stadler <centic@apache.org> | 2021-11-07 14:59:40 +0000 |
commit | 034c95ec55ea4770b02a02466c5c8dacf3329066 (patch) | |
tree | a376feb1fbf48220bc8f5d7641529046c945a69a /poi-scratchpad | |
parent | 4e7b994c2516473429ebc23f2b5acec131f60b67 (diff) | |
download | poi-034c95ec55ea4770b02a02466c5c8dacf3329066.tar.gz poi-034c95ec55ea4770b02a02466c5c8dacf3329066.zip |
Add some more forbidden-apis to prefer core JDK classes over Guava and commons-codec
Also prevent java logging from being used inadvertently
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1894810 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-scratchpad')
-rw-r--r-- | poi-scratchpad/src/test/java/org/apache/poi/hslf/extractor/TestExtractor.java | 5 | ||||
-rw-r--r-- | poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestDocumentEncryption.java | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hslf/extractor/TestExtractor.java b/poi-scratchpad/src/test/java/org/apache/poi/hslf/extractor/TestExtractor.java index f13991370c..303ca4293f 100644 --- a/poi-scratchpad/src/test/java/org/apache/poi/hslf/extractor/TestExtractor.java +++ b/poi-scratchpad/src/test/java/org/apache/poi/hslf/extractor/TestExtractor.java @@ -29,11 +29,12 @@ import java.io.File; import java.io.IOException; import java.io.InputStream; import java.security.MessageDigest; +import java.util.Base64; import java.util.BitSet; import java.util.List; import com.zaxxer.sparsebits.SparseBitSet; -import org.apache.commons.codec.binary.Base64; + import org.apache.poi.POIDataSamples; import org.apache.poi.hslf.usermodel.HSLFObjectShape; import org.apache.poi.hslf.usermodel.HSLFSlideShow; @@ -241,7 +242,7 @@ public final class TestExtractor { sha2.update(IOUtils.toByteArray(is)); } String exp = "lIRRfGMin6B4++WR4XvA82usdQ3ijeHBHU85j523sKY="; - String act = Base64.encodeBase64String(sha2.digest()); + String act = Base64.getEncoder().encodeToString(sha2.digest()); assertEquals(exp, act); } } diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestDocumentEncryption.java b/poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestDocumentEncryption.java index 34945764f2..26c00b64a1 100644 --- a/poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestDocumentEncryption.java +++ b/poi-scratchpad/src/test/java/org/apache/poi/hslf/record/TestDocumentEncryption.java @@ -25,9 +25,9 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.InputStream; import java.security.MessageDigest; +import java.util.Base64; import java.util.List; -import org.apache.commons.codec.binary.Base64; import org.apache.commons.io.output.UnsynchronizedByteArrayOutputStream; import org.apache.poi.POIDataSamples; import org.apache.poi.hpsf.DocumentSummaryInformation; @@ -167,7 +167,7 @@ public class TestDocumentEncryption { for (HSLFPictureData p : pd) { byte[] hash = md.digest(p.getData()); assertEquals(Integer.parseInt(picCmp[i][0]), p.getOffset()); - assertEquals(picCmp[i][1], Base64.encodeBase64String(hash)); + assertEquals(picCmp[i][1], Base64.getEncoder().encodeToString(hash)); i++; } |