@Test(expectedExceptions = CannotUploadExternalResourceException.class)
public void testWriteWhenFileIsAClassFileShouldThrowCannotUploadExternalResourceExceptionWhenTransformingFails() throws IOException {

    //GIVEN
    String fileName = "MyClass.class";
    given(inputStreamUtil.transformToByteArray(inputStream)).willThrow(new IOException());
    //WHEN
    underTest.write(inputStream, fileName, EXCEPTION_MESSAGE);
    //THEN error is thrown
}