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

@@ -1,6 +1,7 @@
package de.cotto.lndmanagej.controller;
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;
@@ -39,6 +40,9 @@ class LegacyControllerIT {
@MockBean
private OwnNodeService ownNodeService;
@MockBean
private FeeService feeService;
@Test
void getAlias() throws Exception {
when(nodeService.getAlias(PUBKEY)).thenReturn(ALIAS);
@@ -75,4 +79,18 @@ class LegacyControllerIT {
mockMvc.perform(get("/legacy/peer-pubkeys"))
.andExpect(content().string(PUBKEY_2 + "\n" + PUBKEY_3));
}
@Test
void getIncomingFeeRate() throws Exception {
when(feeService.getIncomingFeeRate(CHANNEL_ID)).thenReturn(123L);
mockMvc.perform(get("/legacy/channel/" + CHANNEL_ID + "/incoming-fee-rate"))
.andExpect(content().string("123"));
}
@Test
void getOutgoingFeeRate() throws Exception {
when(feeService.getOutgoingFeeRate(CHANNEL_ID)).thenReturn(123L);
mockMvc.perform(get("/legacy/channel/" + CHANNEL_ID + "/outgoing-fee-rate"))
.andExpect(content().string("123"));
}
}