get channel IDs for open channels in compact format

This commit is contained in:
Carsten Otto
2021-11-12 15:55:56 +01:00
parent d4659694d5
commit bc55943f9d
6 changed files with 56 additions and 8 deletions

View File

@@ -15,6 +15,8 @@ import java.util.Set;
import static de.cotto.lndmanagej.model.ChannelIdFixtures.CHANNEL_ID;
import static de.cotto.lndmanagej.model.ChannelIdFixtures.CHANNEL_ID_3;
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.LocalChannelFixtures.LOCAL_CHANNEL;
import static de.cotto.lndmanagej.model.LocalChannelFixtures.LOCAL_CHANNEL_3;
import static de.cotto.lndmanagej.model.LocalChannelFixtures.LOCAL_CHANNEL_TO_NODE_3;
@@ -74,6 +76,13 @@ class LegacyControllerIT {
.andExpect(content().string(CHANNEL_ID + "\n" + CHANNEL_ID_3));
}
@Test
void getOpenChannelIdsCompact() throws Exception {
when(channelService.getOpenChannels()).thenReturn(Set.of(LOCAL_CHANNEL, LOCAL_CHANNEL_3));
mockMvc.perform(get("/legacy/open-channels/compact"))
.andExpect(content().string(CHANNEL_ID_COMPACT + "\n" + CHANNEL_ID_COMPACT_3));
}
@Test
void isSyncedToChain_true() throws Exception {
when(ownNodeService.isSyncedToChain()).thenReturn(true);