File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
src/test/java/io/ipfs/api Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -137,16 +137,16 @@ public void directoryTest() throws IOException {
137137 List <MerkleNode > addParts = ipfs .add (new NamedStreamable .FileWrapper (tmpDir .toFile ()));
138138 MerkleNode addResult = addParts .get (addParts .size () - 1 );
139139 List <MerkleNode > lsResult = ipfs .ls (addResult .hash );
140- if (lsResult .size () != 1 )
140+ if (lsResult .size () != 2 )
141141 throw new IllegalStateException ("Incorrect number of objects in ls!" );
142- if (!lsResult .get (0 ). equals (addResult ))
143- throw new IllegalStateException ("Object not returned in ls!" );
142+ if (! lsResult .stream (). map ( x -> x . name . get ()). collect ( Collectors . toSet ()). equals (Set . of ( subdirName , fileName ) ))
143+ throw new IllegalStateException ("Dir not returned in ls!" );
144144 byte [] catResult = ipfs .cat (addResult .hash , "/" + fileName );
145- if (!Arrays .equals (catResult , fileContents ))
145+ if (! Arrays .equals (catResult , fileContents ))
146146 throw new IllegalStateException ("Different contents!" );
147147
148148 byte [] catResult2 = ipfs .cat (addResult .hash , "/" + subdirName + "/" + subfileName );
149- if (!Arrays .equals (catResult2 , file2Contents ))
149+ if (! Arrays .equals (catResult2 , file2Contents ))
150150 throw new IllegalStateException ("Different contents!" );
151151 }
152152
You can’t perform that action at this time.
0 commit comments