use of com.willwinder.universalgcodesender.listeners.SerialCommunicatorListener in project Universal-G-Code-Sender by winder.
the class BufferedCommunicatorTest method responseMessageOnErrorShouldDispatchPauseEvent.
@Test
public void responseMessageOnErrorShouldDispatchPauseEvent() {
// Given
Connection connection = mock(Connection.class);
instance.setConnection(connection);
SerialCommunicatorListener serialCommunicatorListener = mock(SerialCommunicatorListener.class);
instance.addCommandEventListener(serialCommunicatorListener);
asl.add(new GcodeCommand("G0"));
asl.add(new GcodeCommand("G0"));
instance.streamCommands();
// When
instance.responseMessage("error");
// Then
assertTrue(instance.isPaused());
verify(serialCommunicatorListener, times(1)).communicatorPausedOnError();
}
Aggregations