File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,8 @@ class FileWrapper implements NamedStreamable {
2929 private final File source ;
3030
3131 public FileWrapper (File source ) {
32+ if (! source .exists ())
33+ throw new IllegalStateException ("File does not exist: " + source );
3234 this .source = source ;
3335 }
3436
Original file line number Diff line number Diff line change @@ -22,16 +22,17 @@ public class APITest {
2222
2323 @ Test
2424 public void dag () throws IOException {
25- byte [] object = "{\" data\" :1234}" .getBytes ();
25+ String original = "{\" data\" :1234}" ;
26+ byte [] object = original .getBytes ();
2627 MerkleNode put = ipfs .dag .put ("json" , object );
2728
28- Cid expected = Cid .decode ("zdpuB2CbdLrUK5AgZusm4hraisDDDC135ugdmZWvMHhhsSYTb " );
29+ Cid expected = Cid .decode ("zdpuAs3whHmb9T1NkHSLGF45ykcKrEBxSLiEx6YpLzmKbQLEB " );
2930
3031 Multihash result = put .hash ;
3132 Assert .assertTrue ("Correct cid returned" , result .equals (expected ));
3233
3334 byte [] get = ipfs .dag .get (expected );
34- Assert .assertTrue ("Raw data equal" , Arrays .equals (object , get ));
35+ Assert .assertTrue ("Raw data equal" , original .equals (new String ( get ). trim () ));
3536 }
3637
3738 @ Test
You can’t perform that action at this time.
0 commit comments