mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2026-01-22 15:35:10 +01:00
add fee-configuration endpoint for channel
This commit is contained in:
@@ -20,6 +20,7 @@ import static de.cotto.lndmanagej.model.ChannelFixtures.CAPACITY;
|
||||
import static de.cotto.lndmanagej.model.ChannelIdFixtures.CHANNEL_ID;
|
||||
import static de.cotto.lndmanagej.model.ChannelPointFixtures.CHANNEL_POINT;
|
||||
import static de.cotto.lndmanagej.model.FeeConfigurationFixtures.FEE_CONFIGURATION;
|
||||
import static de.cotto.lndmanagej.model.LocalOpenChannelFixtures.LOCAL_OPEN_CHANNEL;
|
||||
import static de.cotto.lndmanagej.model.LocalOpenChannelFixtures.LOCAL_OPEN_CHANNEL_PRIVATE;
|
||||
import static de.cotto.lndmanagej.model.NodeFixtures.ALIAS_2;
|
||||
import static de.cotto.lndmanagej.model.PubkeyFixtures.PUBKEY_2;
|
||||
@@ -102,4 +103,15 @@ class ChannelControllerIT {
|
||||
mockMvc.perform(get(CHANNEL_PREFIX + "/details"))
|
||||
.andExpect(status().isNotFound());
|
||||
}
|
||||
|
||||
@Test
|
||||
void getFeeConfiguration() throws Exception {
|
||||
when(channelService.getLocalChannel(CHANNEL_ID)).thenReturn(Optional.of(LOCAL_OPEN_CHANNEL));
|
||||
when(feeService.getFeeConfiguration(CHANNEL_ID)).thenReturn(FEE_CONFIGURATION);
|
||||
mockMvc.perform(get(CHANNEL_PREFIX + "/fee-configuration"))
|
||||
.andExpect(jsonPath("$.outgoingFeeRatePpm", is(1)))
|
||||
.andExpect(jsonPath("$.outgoingBaseFeeMilliSat", is(2)))
|
||||
.andExpect(jsonPath("$.incomingFeeRatePpm", is(3)))
|
||||
.andExpect(jsonPath("$.incomingBaseFeeMilliSat", is(4)));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user