get force-closing channels

This commit is contained in:
Carsten Otto
2021-11-16 19:58:23 +01:00
parent 0c892ca88e
commit 6b8614a614
14 changed files with 246 additions and 4 deletions

View File

@@ -21,6 +21,8 @@ import static de.cotto.lndmanagej.model.ChannelIdFixtures.CHANNEL_ID_COMPACT;
import static de.cotto.lndmanagej.model.ChannelIdFixtures.CHANNEL_ID_COMPACT_3;
import static de.cotto.lndmanagej.model.ClosedChannelFixtures.CLOSED_CHANNEL;
import static de.cotto.lndmanagej.model.ClosedChannelFixtures.CLOSED_CHANNEL_3;
import static de.cotto.lndmanagej.model.ForceClosingChannelFixtures.FORCE_CLOSING_CHANNEL;
import static de.cotto.lndmanagej.model.ForceClosingChannelFixtures.FORCE_CLOSING_CHANNEL_3;
import static de.cotto.lndmanagej.model.LocalOpenChannelFixtures.LOCAL_OPEN_CHANNEL;
import static de.cotto.lndmanagej.model.LocalOpenChannelFixtures.LOCAL_OPEN_CHANNEL_3;
import static de.cotto.lndmanagej.model.LocalOpenChannelFixtures.LOCAL_OPEN_CHANNEL_TO_NODE_3;
@@ -115,6 +117,14 @@ class LegacyControllerIT {
.andExpect(content().string(CHANNEL_ID + "\n" + CHANNEL_ID_3));
}
@Test
void getForceClosingChannels() throws Exception {
when(channelService.getForceClosingChannels())
.thenReturn(Set.of(FORCE_CLOSING_CHANNEL, FORCE_CLOSING_CHANNEL_3));
mockMvc.perform(get("/legacy/force-closing-channels"))
.andExpect(content().string(CHANNEL_ID + "\n" + CHANNEL_ID_3));
}
@Test
void isSyncedToChain_true() throws Exception {
when(ownNodeService.isSyncedToChain()).thenReturn(true);