@Test public void sendWhenDisconnected() { LinkConnectionEventListener linkConnectionEventListenerMock = mock(LinkConnectionEventListener.class); link.addLinkEventListener(linkConnectionEventListenerMock); link.sendPacket(mock(InterledgerPreparePacket.class)); assertThat(onConnectCalled.get()).isEqualTo(false); assertThat(onDisconnectCalled.get()).isEqualTo(false); }
@Override public void addLinkEventListener(final LinkConnectionEventListener linkConnectionEventListener) { Objects.requireNonNull(linkConnectionEventListener); this.linkConnectionEventEmitter.addLinkConnectionEventListener(linkConnectionEventListener); }
AbstractStatefulLink extends AbstractLink<L> implements StatefulLink<L> { @Override public void addLinkEventListener(final LinkConnectionEventListener linkConnectionEventListener) { Objects.requireNonNull(linkConnectionEventListener); this.linkConnectionEventEmitter.addLinkConnectionEventListener(linkConnectionEventListener); } }
AbstractStatefulLink extends AbstractLink<L> implements StatefulLink<L> { @Override public void addLinkEventListener(final LinkConnectionEventListener linkConnectionEventListener) { Objects.requireNonNull(linkConnectionEventListener); this.linkConnectionEventEmitter.addLinkConnectionEventListener(linkConnectionEventListener); } protected  AbstractStatefulLink(
      final Supplier<InterledgerAddress> operatorAddressSupplier,
      final L linkSettings,
      final LinkConnectionEventEmitter linkConnectionEventEmitter
  ); }
AbstractStatefulLink extends AbstractLink<L> implements StatefulLink<L> { @Override public void addLinkEventListener(final LinkConnectionEventListener linkConnectionEventListener) { Objects.requireNonNull(linkConnectionEventListener); this.linkConnectionEventEmitter.addLinkConnectionEventListener(linkConnectionEventListener); } protected  AbstractStatefulLink(
      final Supplier<InterledgerAddress> operatorAddressSupplier,
      final L linkSettings,
      final LinkConnectionEventEmitter linkConnectionEventEmitter
  ); @Override final CompletableFuture<Void> connect(); abstract CompletableFuture<Void> doConnect(); @Override void close(); @Override final CompletableFuture<Void> disconnect(); abstract CompletableFuture<Void> doDisconnect(); @Override boolean isConnected(); @Override void addLinkEventListener(final LinkConnectionEventListener linkConnectionEventListener); @Override void removeLinkEventListener(final LinkConnectionEventListener linkConnectionEventListener); }
AbstractStatefulLink extends AbstractLink<L> implements StatefulLink<L> { @Override public void addLinkEventListener(final LinkConnectionEventListener linkConnectionEventListener) { Objects.requireNonNull(linkConnectionEventListener); this.linkConnectionEventEmitter.addLinkConnectionEventListener(linkConnectionEventListener); } protected  AbstractStatefulLink(
      final Supplier<InterledgerAddress> operatorAddressSupplier,
      final L linkSettings,
      final LinkConnectionEventEmitter linkConnectionEventEmitter
  ); @Override final CompletableFuture<Void> connect(); abstract CompletableFuture<Void> doConnect(); @Override void close(); @Override final CompletableFuture<Void> disconnect(); abstract CompletableFuture<Void> doDisconnect(); @Override boolean isConnected(); @Override void addLinkEventListener(final LinkConnectionEventListener linkConnectionEventListener); @Override void removeLinkEventListener(final LinkConnectionEventListener linkConnectionEventListener);  }