@Test
public void checkOnRestore() {
final ObservablePath dtGraphPath = mock(ObservablePath.class);
final PathPlaceRequest dtGraphPlaceRequest = mock(PathPlaceRequest.class);
final GuidedDecisionTableEditorGraphContent dtGraphContent = makeDecisionTableGraphContent();
final RestoreEvent event = new RestoreEvent(dtGraphPath);
when(dtGraphPath.toURI()).thenReturn("dtGraphPath");
when(dtGraphPath.getFileName()).thenReturn("filename");
when(dtGraphService.loadContent(eq(dtGraphPath))).thenReturn(dtGraphContent);
when(versionRecordManager.getCurrentPath()).thenReturn(dtGraphPath);
when(versionRecordManager.getPathToLatest()).thenReturn(dtGraphPath);
presenter.onStartup(dtGraphPath,
dtGraphPlaceRequest);
verify(presenter,
times(1)).initialiseEditor(eq(dtGraphPath),
eq(dtGraphPlaceRequest));
presenter.onRestore(event);
verify(presenter,
times(2)).initialiseEditor(eq(dtGraphPath),
eq(dtGraphPlaceRequest));
verify(notification,
times(1)).fire(any(NotificationEvent.class));
}