AbstractSender extends AbstractHonoClient implements MessageSender { @Override public final int getCredit() { if (sender == null) { return 0; } else { return sender.getCredit(); } } protected  AbstractSender(
            final HonoConnection connection,
            final ProtonSender sender,
            final String tenantId,
            final String targetAddress,
            final SendMessageSampler sampler); @Override final int getCredit(); @Override final void sendQueueDrainHandler(final Handler<Void> handler); @Override final void close(final Handler<AsyncResult<Void>> closeHandler); @Override final boolean isOpen(); @Override final Future<ProtonDelivery> send(final Message rawMessage); @Override final Future<ProtonDelivery> send(final Message rawMessage, final SpanContext parent);  }
@Test public void testCredits() { final AbstractSender sender = newSender("tenant", "endpoint"); when(protonSender.getCredit()).thenReturn(10); assertThat(sender.getCredit()).isEqualTo(10); when(protonSender.getCredit()).thenReturn(0); assertThat(sender.getCredit()).isEqualTo(0); }