@Test
public void testErrorSavingData() {

    when(noteSaver.save(anyString(), any(Note.class)))
            .thenThrow(TestData.networkError());
    NoteModel model = viewModel.initAndResume(TestData.ID_A);
    model.getTitle().set(TestData.NEW_TITLE);
    model.getText().set(TestData.NEW_TEXT);
    viewModel.save();
    verify(messageManager).showMessage(any(ActivityHolder.class), eq(R.string.error_saving_note));
}