1 package unit.ui.controllers.device_setup_controller.handle_go_button_clicked;
3 import gnu.io.UnsupportedCommOperationException;
4 import javafx.scene.text.Text;
5 import org.jetbrains.annotations.Contract;
8 import java.util.Optional;
10 import static org.junit.Assert.fail;
18 private static final String queryForMessage =
19 "#comm-operation-exception-message";
22 public void clickGoButton(){
23 clickOn(queryForGoButton);
24 Optional<Text> message = lookup(queryForMessage).tryQuery();
26 if(!message.isPresent()){
29 "No message found. Query used was %s",
36 @Contract(
" -> !null")
39 return new UnsupportedCommExceptionExpectations();
42 private class UnsupportedCommExceptionExpectations
extends 44 public UnsupportedCommExceptionExpectations(){
49 private void exceptionThrower(){
51 oneOf(factory).makePowerSupply();
52 will(throwException(
new UnsupportedCommOperationException()));
54 oneOf(pressureGaugeFactory).makePressureGauge();
55 }
catch (Exception error){
56 error.printStackTrace();