Console extends JFrame implements Linkable { public Link getLink() { return link; } Console(); static void main(String[] args); @Override void setEnabled(boolean enabled); @Override void setLink(Link newLink); Link getLink();  }
@Test public void whenStartedConnectIsEnabledAndDisconnnectIsDisabled() { assumeThat(isHeadless(), is(FALSE)); Console console = newConsole(); assertThat(console.getLink(), is(nullValue())); assertThat(console.btnConnect.isEnabled(), is(TRUE)); assertThat(console.btnDisconnect.isEnabled(), is(FALSE)); }
@Test public void whenConnectButtonIsClickedLinkIsExchangedAndPopertyChangeEventsIsFired() { assumeThat(isHeadless(), is(FALSE)); Console console = newConsole(); console.btnConnect.doClick(); assertThat(console.getLink(), is(connectLink)); assertThat(console.btnConnect.isEnabled(), is(FALSE)); assertThat(console.btnDisconnect.isEnabled(), is(TRUE)); }
@Test public void whenDisconnectButtonIsClickedLinkIsExchangedAndPopertyChangeEventsIsFired() { assumeThat(isHeadless(), is(FALSE)); Console console = newConsole(); console.btnConnect.doClick(); console.btnDisconnect.doClick(); assertThat(console.getLink(), is(nullValue())); assertThat(console.btnConnect.isEnabled(), is(TRUE)); assertThat(console.btnDisconnect.isEnabled(), is(FALSE)); }