AbstractRequestResponseClient extends AbstractHonoClient implements RequestResponseClient { @Override public final int getCredit() { if (sender == null) { return 0; } else { return sender.getCredit(); } } protected  AbstractRequestResponseClient(
            final HonoConnection connection,
            final String tenantId,
            final SendMessageSampler sampler); protected  AbstractRequestResponseClient(
            final HonoConnection connection,
            final String tenantId,
            final String replyId,
            final SendMessageSampler sampler); protected  AbstractRequestResponseClient(
            final HonoConnection connection,
            final String tenantId,
            final String deviceId,
            final String replyId,
            final SendMessageSampler sampler); protected  AbstractRequestResponseClient(
            final HonoConnection connection,
            final String tenantId,
            final ProtonSender sender,
            final ProtonReceiver receiver,
            final SendMessageSampler sampler); final void setResponseCache(final ExpiringValueCache<Object, R> cache); @Override final void setRequestTimeout(final long timoutMillis); @Override final int getCredit(); @Override final void sendQueueDrainHandler(final Handler<Void> handler); @Override final boolean isOpen(); @Override final void close(final Handler<AsyncResult<Void>> closeHandler);  }
@Test public void testGetCreditsReturnsCreditsOfSenderLink() { when(sender.getCredit()).thenReturn(10, 0); assertThat(client.getCredit()).isEqualTo(10); assertThat(client.getCredit()).isEqualTo(0); }