BakeoutController-Basic  0.1
A Controller for the Omicron vacuum chamber
HappyPath.java
1 package unit.ui.controllers.device_setup_controller.handle_go_button_clicked;
2 
3 import org.jetbrains.annotations.Contract;
4 import org.junit.Test;
6 
7 import static org.junit.Assert.assertEquals;
8 
12 public final class HappyPath extends
14 
15  @Test
16  public void clickGoButton(){
17  assertEquals(
18  expectedPortName,
19  portSelector.getSelectionModel().getSelectedItem()
20  );
21 
22  clickOn(queryForGoButton);
23  }
24 
25  @Contract(" -> !null")
26  @Override
27  protected ExpectationsForMockFactory getMockingExpectations(){
28  return new HappyPathExpectations();
29  }
30 
31  private class HappyPathExpectations extends ExpectationsForMockFactory {
32  public HappyPathExpectations(){
33  super();
34 
35  expectationsForGetPowerSupply();
36  }
37 
38  private void expectationsForGetPowerSupply(){
39  try {
40  oneOf(factory).makePowerSupply();
41  oneOf(pressureGaugeFactory).makePressureGauge();
42  } catch (Exception error){
43  error.printStackTrace();
44  }
45  }
46  }
47 }
Git Repo