1 package unit.ui.controllers.device_list_controller;
     3 import javafx.scene.text.Text;
     5 import org.jmock.Expectations;
     6 import org.jmock.Mockery;
     7 import org.junit.Before;
    10 import java.util.Optional;
    12 import static org.junit.Assert.fail;
    22     public void setUpForNoPowerSupply() {
    23         applicationContext.getBean(Mockery.class).checking(
    24                 new ExpectationsForNoPowerSupply()
    29     public void testNoPowerSupply() {
    31         clickOn(queryForRefreshButton);
    33         Optional<Text> message = lookup(queryForNoPowerSupply).tryQuery();
    35         if (!message.isPresent()) {
    36             fail(
"The test did not make the no-power-supply message appear");
    41     private class ExpectationsForNoPowerSupply 
extends Expectations {
    42         public ExpectationsForNoPowerSupply() {
    45             will(returnValue(Boolean.FALSE));
    49             will(returnValue(Boolean.FALSE));