@Test
public void preUpdateWithBrandNewFile() {

    final String name = "name";
    final List<Receipt> receiptsInTrip = Arrays.asList(mock(Receipt.class), mock(Receipt.class), mock(Receipt.class));
    when(receiptsTable.get(trip)).thenReturn(Single.just(receiptsInTrip));
    final Receipt oldReceipt = mock(Receipt.class);
    when(oldReceipt.getFile()).thenReturn(null);
    when(oldReceipt.getDate()).thenReturn(DATE);
    when(oldReceipt.getTimeZone()).thenReturn(TIMEZONE);
    when(receipt.getIndex()).thenReturn(4);
    when(receipt.getName()).thenReturn(name);
    when(receipt.getFile()).thenReturn(new File("12345.jpg"));
    final List<Receipt> result = receiptTableActionAlterations.preUpdate(oldReceipt, receipt)
            .test()
            .assertComplete()
            .assertNoErrors()
            .values();
    assertEquals(1, result.size());
    final Receipt receipt = result.get(0);
    assertEquals(new File("4_name.jpg"), receipt.getFile());
}