use of nl.tudelft.watchdog.eclipse.logic.ui.listeners.WorkbenchListener in project watchdog by TestRoots.
the class MarkupModelListenerTest method setup.
@Before
public void setup() throws Exception {
WatchDogEventType.intervalManager = Mockito.mock(IntervalManager.class);
WatchDogEventType.editorSpecificImplementation = Mockito.mock(WatchDogEventEditorSpecificImplementation.class);
this.transferManager = Mockito.mock(TransferManager.class);
this.trackingEventManager = Mockito.mock(TrackingEventManager.class);
this.generatedEvents = new ArrayList<>();
Mockito.doAnswer(new Answer<Object>() {
@SuppressWarnings("unchecked")
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
Stream<StaticAnalysisWarningEvent> stream = (Stream<StaticAnalysisWarningEvent>) invocation.getArguments()[0];
stream.map(StaticAnalysisWarningEvent::getType).forEach(generatedEvents::add);
return null;
}
}).when(this.trackingEventManager).addEvents(Mockito.any());
this.setUpTestingProject();
this.workbenchListener = new WorkbenchListener(trackingEventManager, transferManager);
this.workbenchListener.attachListeners();
}
Aggregations