@Test
public void importExifUriWithRotateOn() throws Exception {

    final Uri uri = Uri.fromFile(destination);
    configureUriForStream(uri, SAMPLE_JPG_WITH_EXIF);
    when(preferences.get(UserPreference.Camera.AutomaticallyRotateImages)).thenReturn(true);
    when(storageManager.writeBitmap(any(Uri.class), bitmapCaptor.capture(), eq(Bitmap.CompressFormat.JPEG), eq(ImageImportProcessor.COMPRESSION_QUALITY))).thenReturn(true);
    importProcessor.process(uri)
            .test()
            .assertValue(destination)
            .assertComplete();
    final Bitmap bitmap = bitmapCaptor.getValue();
    assertNotNull(bitmap);
    // TODO: Use direct getWidth/getHeight test once Robolectric 3.2 is available
    // TODO: Remove this shadow hack once the Robolectric supports this rotation via ShadowBitmap
    // TODO: assertEquals(550, bitmap.getWidth());
    // TODO: assertEquals(400, bitmap.getHeight());
    // Confirm that we have a matrix to rotate this
    final ShadowBitmap shadowBitmap = Shadows.shadowOf(bitmap);
    final ShadowMatrix shadowMatrix = Shadows.shadowOf(shadowBitmap.getCreatedFromMatrix());
    assertEquals(shadowMatrix.getSetOperations().get(ShadowMatrix.ROTATE), "90.0");
}