diff --git a/pom.xml b/pom.xml
index 5582a49..dd583fe 100644
--- a/pom.xml
+++ b/pom.xml
@@ -35,8 +35,6 @@
UTF-8
UTF-8
11
- 4.13.2
- 2.2
v1.4.13
@@ -47,15 +45,9 @@
${version.multiaddr}
- junit
- junit
- ${version.junit}
- test
-
-
- org.hamcrest
- hamcrest
- ${version.hamcrest}
+ org.junit.jupiter
+ junit-jupiter-api
+ 6.0.2
test
diff --git a/src/test/java/io/ipfs/api/APITest.java b/src/test/java/io/ipfs/api/APITest.java
index 0a30cf4..0c79b6a 100644
--- a/src/test/java/io/ipfs/api/APITest.java
+++ b/src/test/java/io/ipfs/api/APITest.java
@@ -1,9 +1,12 @@
package io.ipfs.api;
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import io.ipfs.api.cbor.CborObject;
import io.ipfs.cid.Cid;
@@ -31,9 +34,8 @@
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
-import org.junit.Assert;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
@SuppressWarnings({"rawtypes", "unused"})
public class APITest {
@@ -53,14 +55,14 @@ public void dag() throws IOException {
Cid expected = Cid.decode("bafyreidbm2zncsc3j25zn7lofgd4woeh6eygdy73thfosuni2rwr3bhcvu");
Multihash result = put.hash;
- assertEquals("Correct cid returned", result, expected);
+ assertEquals(result, expected, "Correct cid returned");
byte[] get = ipfs.dag.get(expected);
- assertEquals("Raw data equal", original, new String(get).trim());
+ assertEquals(original, new String(get).trim(), "Raw data equal");
Map res = ipfs.dag.resolve("bafyreidbm2zncsc3j25zn7lofgd4woeh6eygdy73thfosuni2rwr3bhcvu");
- assertNotNull("not resolved", res);
+ assertNotNull(res, "not resolved");
res = ipfs.dag.stat(expected);
- assertNotNull("not found", res);
+ assertNotNull(res, "not found");
}
@Test
@@ -75,10 +77,10 @@ public void dagCbor() throws IOException {
Cid cid = (Cid) put.hash;
byte[] get = ipfs.dag.get(cid);
- assertEquals("Raw data equal", ((Map) JSONParser.parse(new String(get))).get("data"), value);
+ assertEquals(((Map) JSONParser.parse(new String(get))).get("data"), value, "Raw data equal");
Cid expected = Cid.decode("zdpuApemz4XMURSCkBr9W5y974MXkSbeDfLeZmiQTPpvkatFF");
- assertEquals("Correct cid returned", cid, expected);
+ assertEquals(cid, expected, "Correct cid returned");
}
@Test
@@ -90,17 +92,16 @@ public void keys() throws IOException {
Object rename = ipfs.key.rename(name, newName);
List rm = ipfs.key.rm(newName);
List remaining = ipfs.key.list();
- assertEquals("removed key", remaining, existing);
+ assertEquals(remaining, existing, "removed key");
}
@Test
- @Ignore("Not reliable")
+ @Disabled("Not reliable")
public void log() throws IOException {
Map lsResult = ipfs.log.ls();
- Assert.assertFalse("Log ls", lsResult.isEmpty());
+ assertFalse(lsResult.isEmpty(), "Log ls");
Map levelResult = ipfs.log.level("all", "info");
- Assert.assertTrue(
- "Log level", ((String) levelResult.get("Message")).startsWith("Changed log level"));
+ assertTrue(((String) levelResult.get("Message")).startsWith("Changed log level"), "Log level");
}
@Test
@@ -114,7 +115,7 @@ public void ipldNode() {
IpldNode.CborIpldNode node = new IpldNode.CborIpldNode(cbor);
List tree = node.tree("", -1);
- assertEquals("Correct tree", tree, Arrays.asList("/a/b", "/c"));
+ assertEquals(tree, Arrays.asList("/a/b", "/c"), "Correct tree");
}
@Test
@@ -148,7 +149,7 @@ public void dirTest() throws IOException {
List add = ipfs.add(dir);
MerkleNode addResult = add.get(add.size() - 1);
List ls = ipfs.ls(addResult.hash);
- Assert.assertTrue(ls.size() > 0);
+ assertTrue(ls.size() > 0);
}
@Test
@@ -194,7 +195,7 @@ public void directoryTest() throws IOException {
throw new IllegalStateException("Different contents!");
}
- @Ignore
+ @Disabled
@Test
public void largeFileTest() throws IOException {
byte[] largerData = new byte[100 * 1024 * 1024];
@@ -204,7 +205,7 @@ public void largeFileTest() throws IOException {
fileTest(largeFile);
}
- @Ignore
+ @Disabled
@Test
public void hugeFileStreamTest() throws IOException {
byte[] hugeData = new byte[1000 * 1024 * 1024];
@@ -275,7 +276,7 @@ public void filesTest() throws IOException {
Map stat = ipfs.files.stat(path);
Map stat2 = ipfs.files.stat(path, Optional.of(""), true);
String readContents = new String(ipfs.files.read(path));
- assertEquals("Should be equals", contents, readContents);
+ assertEquals(contents, readContents, "Should be equals");
res = ipfs.files.rm(path, false, false);
String tempFilename = "temp.txt";
@@ -316,23 +317,23 @@ public void filesTest() throws IOException {
@Test
public void multibaseTest() throws IOException {
List