@Test public void sendPacket() { final InterledgerFulfillPacket actualFulfillPacket = InterledgerFulfillPacket.builder() .fulfillment(ALL_ZEROS_FULFILLMENT) .build(); when(streamReceiverMock.receiveMoney(any(), any(), any())).thenReturn(actualFulfillPacket); final InterledgerPreparePacket preparePacket = preparePacket(); link.sendPacket(preparePacket).handle( fulfillPacket -> { assertThat(fulfillPacket).isEqualTo(actualFulfillPacket); }, rejectPacket -> { logger.error("rejectPacket={}", rejectPacket); fail("Expected a Fulfill"); } ); }
@Override public InterledgerResponsePacket sendPacket(final InterledgerPreparePacket preparePacket) { Objects.requireNonNull(preparePacket, "preparePacket must not be null"); return streamReceiver.receiveMoney(preparePacket, this.getOperatorAddressSupplier().get(), this.denomination) .map(fulfillPacket -> { if (logger.isDebugEnabled()) { logger.debug("Packet fulfilled! preparePacket={} fulfillPacket={}", preparePacket, fulfillPacket); } return fulfillPacket; }, rejectPacket -> { if (logger.isDebugEnabled()) { logger.debug("Packet rejected! preparePacket={} rejectPacket={}", preparePacket, rejectPacket); } return rejectPacket; } ); }
StatelessSpspReceiverLink extends AbstractLink<StatelessSpspReceiverLinkSettings> implements Link<StatelessSpspReceiverLinkSettings> { @Override public InterledgerResponsePacket sendPacket(final InterledgerPreparePacket preparePacket) { Objects.requireNonNull(preparePacket, "preparePacket must not be null"); return streamReceiver.receiveMoney(preparePacket, this.getOperatorAddressSupplier().get(), this.denomination) .map(fulfillPacket -> { if (logger.isDebugEnabled()) { logger.debug("Packet fulfilled! preparePacket={} fulfillPacket={}", preparePacket, fulfillPacket); } return fulfillPacket; }, rejectPacket -> { if (logger.isDebugEnabled()) { logger.debug("Packet rejected! preparePacket={} rejectPacket={}", preparePacket, rejectPacket); } return rejectPacket; } ); } }
StatelessSpspReceiverLink extends AbstractLink<StatelessSpspReceiverLinkSettings> implements Link<StatelessSpspReceiverLinkSettings> { @Override public InterledgerResponsePacket sendPacket(final InterledgerPreparePacket preparePacket) { Objects.requireNonNull(preparePacket, "preparePacket must not be null"); return streamReceiver.receiveMoney(preparePacket, this.getOperatorAddressSupplier().get(), this.denomination) .map(fulfillPacket -> { if (logger.isDebugEnabled()) { logger.debug("Packet fulfilled! preparePacket={} fulfillPacket={}", preparePacket, fulfillPacket); } return fulfillPacket; }, rejectPacket -> { if (logger.isDebugEnabled()) { logger.debug("Packet rejected! preparePacket={} rejectPacket={}", preparePacket, rejectPacket); } return rejectPacket; } ); } StatelessSpspReceiverLink(
      final Supplier<InterledgerAddress> operatorAddressSupplier,
      final StatelessSpspReceiverLinkSettings linkSettings,
      final StreamReceiver streamReceiver
  ); }
StatelessSpspReceiverLink extends AbstractLink<StatelessSpspReceiverLinkSettings> implements Link<StatelessSpspReceiverLinkSettings> { @Override public InterledgerResponsePacket sendPacket(final InterledgerPreparePacket preparePacket) { Objects.requireNonNull(preparePacket, "preparePacket must not be null"); return streamReceiver.receiveMoney(preparePacket, this.getOperatorAddressSupplier().get(), this.denomination) .map(fulfillPacket -> { if (logger.isDebugEnabled()) { logger.debug("Packet fulfilled! preparePacket={} fulfillPacket={}", preparePacket, fulfillPacket); } return fulfillPacket; }, rejectPacket -> { if (logger.isDebugEnabled()) { logger.debug("Packet rejected! preparePacket={} rejectPacket={}", preparePacket, rejectPacket); } return rejectPacket; } ); } StatelessSpspReceiverLink(
      final Supplier<InterledgerAddress> operatorAddressSupplier,
      final StatelessSpspReceiverLinkSettings linkSettings,
      final StreamReceiver streamReceiver
  ); @Override void registerLinkHandler(final LinkHandler ilpDataHandler); @Override InterledgerResponsePacket sendPacket(final InterledgerPreparePacket preparePacket); @Override String toString(); }
StatelessSpspReceiverLink extends AbstractLink<StatelessSpspReceiverLinkSettings> implements Link<StatelessSpspReceiverLinkSettings> { @Override public InterledgerResponsePacket sendPacket(final InterledgerPreparePacket preparePacket) { Objects.requireNonNull(preparePacket, "preparePacket must not be null"); return streamReceiver.receiveMoney(preparePacket, this.getOperatorAddressSupplier().get(), this.denomination) .map(fulfillPacket -> { if (logger.isDebugEnabled()) { logger.debug("Packet fulfilled! preparePacket={} fulfillPacket={}", preparePacket, fulfillPacket); } return fulfillPacket; }, rejectPacket -> { if (logger.isDebugEnabled()) { logger.debug("Packet rejected! preparePacket={} rejectPacket={}", preparePacket, rejectPacket); } return rejectPacket; } ); } StatelessSpspReceiverLink(
      final Supplier<InterledgerAddress> operatorAddressSupplier,
      final StatelessSpspReceiverLinkSettings linkSettings,
      final StreamReceiver streamReceiver
  ); @Override void registerLinkHandler(final LinkHandler ilpDataHandler); @Override InterledgerResponsePacket sendPacket(final InterledgerPreparePacket preparePacket); @Override String toString(); static final String LINK_TYPE_STRING; static final LinkType LINK_TYPE; }