use of com.google.cloud.tools.jib.http.BlobHttpContent in project jib by GoogleContainerTools.
the class BlobPusherTest method testWriter_getContent.
@Test
public void testWriter_getContent() throws IOException {
LongAdder byteCount = new LongAdder();
BlobHttpContent body = testBlobPusher.writer(mockUrl, byteCount::add).getContent();
Assert.assertNotNull(body);
Assert.assertEquals("application/octet-stream", body.getType());
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
body.writeTo(byteArrayOutputStream);
Assert.assertEquals(TEST_BLOB_CONTENT, new String(byteArrayOutputStream.toByteArray(), StandardCharsets.UTF_8));
Assert.assertEquals(TEST_BLOB_CONTENT.length(), byteCount.sum());
}
Aggregations