OutputSocketController implements Controller { @VisibleForTesting ToggleButton previewButton() { return preview; } @Inject  OutputSocketController(SocketHandleView.Factory socketHandleFactory, @Assisted OutputSocket
      socket); Socket<?> getSocket(); SocketHandleView getHandle(); @Subscribe void onSocketChanged(SocketChangedEvent event); @Subscribe void onSocketPreviewChangedEvent(SocketPreviewChangedEvent event); @Override Node getRoot();  }
@Test public void testClickOnButton() throws Exception { clickOn(defaultOutputSocketController.previewButton()); WaitForAsyncUtils.waitForFxEvents(); assertTrue("The output socket was not made previewed when button was clicked", outputSocket .isPreviewed()); }
@Test public void testClickOnButtonTwice() throws Exception { clickOn(defaultOutputSocketController.previewButton()); clickOn(defaultOutputSocketController.previewButton()); WaitForAsyncUtils.waitForFxEvents(); assertFalse("The output socket was not made not previewed when button was clicked twice", outputSocket.isPreviewed()); }
@Test public void testInitiallyPreviewedOutputSocket() { assertTrue("The preview button did not initialize selected", initiallyPreviewedOutputSocketController.previewButton().isSelected()); }