+ protected void addTemporaryImage(String imageId, TemporaryImage temporaryImage) {
+ when(core.getTemporaryImage(eq(imageId))).thenReturn(temporaryImage);
+ }
+
+ protected byte[] getResponseBytes() throws IOException {
+ response.getContent().close();
+ try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) {
+ ByteStreams.copy(responseInputStream, outputStream);
+ return outputStream.toByteArray();
+ }
+ }
+