add incoming-fee-rate and outgoing-fee-rate endpoints

This commit is contained in:
Carsten Otto
2021-11-12 14:47:26 +01:00
parent b8f9af1d72
commit 6cbced801a
16 changed files with 420 additions and 7 deletions

View File

@@ -3,6 +3,7 @@ package de.cotto.lndmanagej.controller;
import de.cotto.lndmanagej.model.ChannelFixtures;
import de.cotto.lndmanagej.model.LocalChannel;
import de.cotto.lndmanagej.service.ChannelService;
import de.cotto.lndmanagej.service.FeeService;
import de.cotto.lndmanagej.service.NodeService;
import de.cotto.lndmanagej.service.OwnNodeService;
import org.junit.jupiter.api.Test;
@@ -40,6 +41,9 @@ class LegacyControllerTest {
@Mock
private OwnNodeService ownNodeService;
@Mock
private FeeService feeService;
@Test
void getAlias() {
when(nodeService.getAlias(PUBKEY)).thenReturn(ALIAS);
@@ -93,4 +97,16 @@ class LegacyControllerTest {
when(channelService.getOpenChannels()).thenReturn(Set.of(LOCAL_CHANNEL, LOCAL_CHANNEL_2));
assertThat(legacyController.getPeerPubkeys()).isEqualTo(PUBKEY_2.toString());
}
@Test
void getIncomingFeeRate() {
when(feeService.getIncomingFeeRate(CHANNEL_ID)).thenReturn(123L);
assertThat(legacyController.getIncomingFeeRate(CHANNEL_ID)).isEqualTo(123);
}
@Test
void getOutgoingFeeRate() {
when(feeService.getOutgoingFeeRate(CHANNEL_ID)).thenReturn(123L);
assertThat(legacyController.getOutgoingFeeRate(CHANNEL_ID)).isEqualTo(123);
}
}