@Test
public void receiveShouldAcceptFileTransferIfArgumentsMatchAndRenameExistingFile() {

    final User someOne = setupSomeOne();
    final FileReceiver fileReceiver = setupFileReceiver(someOne);
    final File file = setupFile(fileReceiver);
    when(file.exists()).thenReturn(true);
    final ArgumentCaptor<File> newFileCaptor = ArgumentCaptor.forClass(File.class);
    parser.parse("/receive SomeOne 1");
    verify(transferList).getFileReceiver(someOne, 1);
    verify(messageController).showSystemMessage("/receive - file 'doc.pdf' already exists - renaming to 'doc_1.pdf'");
    verify(fileReceiver).accept();
    verify(fileReceiver).setFile(newFileCaptor.capture());
    assertEquals("doc_1.pdf", newFileCaptor.getValue().getName());
}