LFSPointerTest: Open ByteArrayOutputStream in try-with-resource
Change-Id: Ib15a838e735f8b960e0ed635d6d9b0caf97f4791 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
This commit is contained in:
parent
91a2be13e5
commit
2d178f5f14
|
@ -61,11 +61,12 @@ public void testEncoding() throws IOException {
|
||||||
final String s = "27e15b72937fc8f558da24ac3d50ec20302a4cf21e33b87ae8e4ce90e89c4b10";
|
final String s = "27e15b72937fc8f558da24ac3d50ec20302a4cf21e33b87ae8e4ce90e89c4b10";
|
||||||
AnyLongObjectId id = LongObjectId.fromString(s);
|
AnyLongObjectId id = LongObjectId.fromString(s);
|
||||||
LfsPointer ptr = new LfsPointer(id, 4);
|
LfsPointer ptr = new LfsPointer(id, 4);
|
||||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
|
||||||
ptr.encode(baos);
|
ptr.encode(baos);
|
||||||
baos.close();
|
assertEquals(
|
||||||
assertEquals("version https://git-lfs.github.com/spec/v1\noid sha256:"
|
"version https://git-lfs.github.com/spec/v1\noid sha256:"
|
||||||
+ s + "\nsize 4\n",
|
+ s + "\nsize 4\n",
|
||||||
baos.toString(UTF_8.name()));
|
baos.toString(UTF_8.name()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue