use of com.willwinder.universalgcodesender.listeners.UGSEventListener in project Universal-G-Code-Sender by winder.
the class GUIBackendTest method setUp.
@Before
public void setUp() throws Exception {
// We need to mock the method that loads the controller
instance = spy(new GUIBackend());
IFirmwareSettings firmwareSettings = mock(IFirmwareSettings.class);
controller = mock(AbstractController.class);
doReturn(controller).when(instance).fetchControllerFromFirmware(any());
doReturn(firmwareSettings).when(controller).getFirmwareSettings();
// Add a event listener that stores events in the argument captor
UGSEventListener ugsEventListener = mock(UGSEventListener.class);
eventArgumentCaptor = ArgumentCaptor.forClass(UGSEvent.class);
doNothing().when(ugsEventListener).UGSEvent(eventArgumentCaptor.capture());
instance.addUGSEventListener(ugsEventListener);
// Add settings
settings = new Settings();
instance.applySettings(settings);
}
Aggregations