@Test public void receiverDoesNotReceiveEventIfProjectIsNull() throws IOException, InterruptedException { ProjectDAO dao = mock(ProjectDAO.class); when(dao.getProjectByFile(any(String.class))).thenReturn(null); this.taker = new SnapshotTaker(new ActiveThreadSet(), receiver, settings, dao); taker.execute(new SnapshotInfo("testProject", "", relPath, "", fullPath, ChangeType.FILE_CHANGE)); Thread.sleep(50); assertEquals(event, null); }
public void execute(SnapshotInfo info) { this.info = info; if (info.getChangeType() == ChangeType.FILE_RENAME || info.getChangeType() == ChangeType.FOLDER_RENAME) { handleRename(); } else { handleChange(); } }
SnapshotTaker { public void execute(SnapshotInfo info) { this.info = info; if (info.getChangeType() == ChangeType.FILE_RENAME || info.getChangeType() == ChangeType.FOLDER_RENAME) { handleRename(); } else { handleChange(); } } }
SnapshotTaker { public void execute(SnapshotInfo info) { this.info = info; if (info.getChangeType() == ChangeType.FILE_RENAME || info.getChangeType() == ChangeType.FOLDER_RENAME) { handleRename(); } else { handleChange(); } } SnapshotTaker(ActiveThreadSet threadSet, EventReceiver receiver, Settings settings, ProjectDAO projectDAO); }
SnapshotTaker { public void execute(SnapshotInfo info) { this.info = info; if (info.getChangeType() == ChangeType.FILE_RENAME || info.getChangeType() == ChangeType.FOLDER_RENAME) { handleRename(); } else { handleChange(); } } SnapshotTaker(ActiveThreadSet threadSet, EventReceiver receiver, Settings settings, ProjectDAO projectDAO); void execute(SnapshotInfo info); }
SnapshotTaker { public void execute(SnapshotInfo info) { this.info = info; if (info.getChangeType() == ChangeType.FILE_RENAME || info.getChangeType() == ChangeType.FOLDER_RENAME) { handleRename(); } else { handleChange(); } } SnapshotTaker(ActiveThreadSet threadSet, EventReceiver receiver, Settings settings, ProjectDAO projectDAO); void execute(SnapshotInfo info);  }