From 1e3f52079473a4e534bd77322540737d6ba83644 Mon Sep 17 00:00:00 2001 From: Bowen Ding Date: Tue, 11 Aug 2020 15:43:21 +0800 Subject: [PATCH] Make tests compatible with Java 8. --- pom.xml | 5 ++--- src/test/java/io/ipfs/api/APITest.java | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index d79f671..a80541e 100644 --- a/pom.xml +++ b/pom.xml @@ -71,9 +71,8 @@ maven-compiler-plugin 3.8.0 - 11 - 11 - 11 + 1.8 + 1.8 diff --git a/src/test/java/io/ipfs/api/APITest.java b/src/test/java/io/ipfs/api/APITest.java index 7bea2cb..14ad774 100755 --- a/src/test/java/io/ipfs/api/APITest.java +++ b/src/test/java/io/ipfs/api/APITest.java @@ -141,7 +141,7 @@ public void directoryTest() throws IOException { List lsResult = ipfs.ls(addResult.hash); if (lsResult.size() != 2) throw new IllegalStateException("Incorrect number of objects in ls!"); - if (! lsResult.stream().map(x -> x.name.get()).collect(Collectors.toSet()).equals(Set.of(subdirName, fileName))) + if (! lsResult.stream().map(x -> x.name.get()).collect(Collectors.toSet()).equals(new HashSet<>(Arrays.asList(subdirName, fileName)))) throw new IllegalStateException("Dir not returned in ls!"); byte[] catResult = ipfs.cat(addResult.hash, "/" + fileName); if (! Arrays.equals(catResult, fileContents))