mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2026-01-28 10:24:24 +01:00
add self payments endpoints (aggregated per peer)
This commit is contained in:
@@ -13,6 +13,7 @@ import java.util.List;
|
||||
import static de.cotto.lndmanagej.SelfPaymentFixtures.SELF_PAYMENT;
|
||||
import static de.cotto.lndmanagej.SelfPaymentFixtures.SELF_PAYMENT_2;
|
||||
import static de.cotto.lndmanagej.model.ChannelIdFixtures.CHANNEL_ID;
|
||||
import static de.cotto.lndmanagej.model.PubkeyFixtures.PUBKEY;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
@@ -24,6 +25,24 @@ class SelfPaymentsControllerTest {
|
||||
@Mock
|
||||
private SelfPaymentsService service;
|
||||
|
||||
@Test
|
||||
void getSelfPaymentsFromChannel() {
|
||||
when(service.getSelfPaymentsFromChannel(CHANNEL_ID)).thenReturn(List.of(SELF_PAYMENT, SELF_PAYMENT_2));
|
||||
assertThat(selfPaymentsController.getSelfPaymentsFromChannel(CHANNEL_ID)).containsExactly(
|
||||
SelfPaymentDto.createFromModel(SELF_PAYMENT),
|
||||
SelfPaymentDto.createFromModel(SELF_PAYMENT_2)
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
void getSelfPaymentsFromPeer() {
|
||||
when(service.getSelfPaymentsFromPeer(PUBKEY)).thenReturn(List.of(SELF_PAYMENT, SELF_PAYMENT_2));
|
||||
assertThat(selfPaymentsController.getSelfPaymentsFromPeer(PUBKEY)).containsExactly(
|
||||
SelfPaymentDto.createFromModel(SELF_PAYMENT),
|
||||
SelfPaymentDto.createFromModel(SELF_PAYMENT_2)
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
void getSelfPaymentsToChannel() {
|
||||
when(service.getSelfPaymentsToChannel(CHANNEL_ID)).thenReturn(List.of(SELF_PAYMENT, SELF_PAYMENT_2));
|
||||
@@ -34,11 +53,12 @@ class SelfPaymentsControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
void getSelfPaymentsFromChannel() {
|
||||
when(service.getSelfPaymentsFromChannel(CHANNEL_ID)).thenReturn(List.of(SELF_PAYMENT, SELF_PAYMENT_2));
|
||||
assertThat(selfPaymentsController.getSelfPaymentsFromChannel(CHANNEL_ID)).containsExactly(
|
||||
void getSelfPaymentsToPeer() {
|
||||
when(service.getSelfPaymentsToPeer(PUBKEY)).thenReturn(List.of(SELF_PAYMENT, SELF_PAYMENT_2));
|
||||
assertThat(selfPaymentsController.getSelfPaymentsToPeer(PUBKEY)).containsExactly(
|
||||
SelfPaymentDto.createFromModel(SELF_PAYMENT),
|
||||
SelfPaymentDto.createFromModel(SELF_PAYMENT_2)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user