@Test
public void preInsertWithoutFile() {

    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));
    when(receipt.getName()).thenReturn(name);
    receiptTableActionAlterations.preInsert(receipt)
            .test()
            .assertValue(receipt)
            .assertComplete()
            .assertNoErrors();
    assertNull(receipt.getFile());
    verify(receiptBuilderFactory).setIndex(4);
    verify(receiptBuilderFactory).setCustomOrderId(CUSTOM_ORDER_ID);
}