Skip to content

Commit

Permalink
JDK9: Migrate from javax.xml.bind.DatatypeConverter to `org.apache.…
Browse files Browse the repository at this point in the history
…commons.codec.binary.Hex`
  • Loading branch information
valery1707 committed Apr 1, 2018
1 parent c2a6804 commit 904e448
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@
<version>1.2.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.11</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/name/valery1707/kaitai/MojoUtilsTest.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package name.valery1707.kaitai;

import com.github.marschall.memoryfilesystem.MemoryFileSystemBuilder;
import org.apache.commons.codec.binary.Hex;
import org.apache.commons.io.IOUtils;
import org.apache.commons.io.output.NullOutputStream;
import org.apache.maven.plugin.MojoExecutionException;
Expand All @@ -9,7 +10,6 @@
import org.junit.Test;
import org.junit.rules.TemporaryFolder;

import javax.xml.bind.DatatypeConverter;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
Expand Down Expand Up @@ -144,7 +144,7 @@ public void testDownload_success() throws IOException, MojoExecutionException, N

MessageDigest digest = MessageDigest.getInstance("SHA1");
Files.copy(target, new DigestOutputStream(new NullOutputStream(), digest));
String hashActual = DatatypeConverter.printHexBinary(digest.digest());
String hashActual = Hex.encodeHexString(digest.digest());

try (
InputStream shaExpected = new URL(source.toExternalForm() + ".sha1").openStream();
Expand Down

0 comments on commit 904e448

Please sign in to comment.