NavigationHyperlinkListener extends HyperlinkAdapter { @Override protected void hyperlinkActivated(HyperlinkEvent e) { navigate(e.getDescription()); } NavigationHyperlinkListener(@NotNull PsContext context);  NavigationHyperlinkListener(@NotNull PsContext context, @NotNull LinkHandler... handlers); void navigate(@NotNull String target);  }
@Test public void navigate_noHandlersAccept() throws Exception { when(myHandler1.accepts(TEST_URL)).thenReturn(false); when(myHandler2.accepts(TEST_URL)).thenReturn(false); listener.hyperlinkActivated( new HyperlinkEvent(this, HyperlinkEvent.EventType.ACTIVATED, null , TEST_URL)); InOrder order = inOrder(myHandler1, myHandler2, myContext); order.verify(myHandler1).accepts(TEST_URL); order.verify(myHandler2).accepts(TEST_URL); order.verifyNoMoreInteractions(); }