1 package unit.ui.controllers.device_setup_controller.handle_go_button_clicked;
3 import javafx.scene.text.Text;
4 import org.jetbrains.annotations.Contract;
8 import java.io.IOException;
9 import java.util.Optional;
11 import static org.junit.Assert.fail;
18 private static final String queryForMessage =
"#io-exception-message";
20 @Contract(
" -> !null")
23 return new IOExceptionExpectations();
27 public void clickGoButton(){
28 clickOn(queryForGoButton);
30 Optional<Text> message = lookup(queryForMessage).tryQuery();
32 if (!message.isPresent()){
35 "Did not find the message. I used the query %s",
43 public IOExceptionExpectations(){
48 private void thrownExpectation(){
50 oneOf(factory).makePowerSupply();
51 will(throwException(
new IOException(
"Inordinate")));
52 oneOf(pressureGaugeFactory).makePressureGauge();
53 }
catch (Exception error){
54 error.printStackTrace();