mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2026-01-23 07:54:24 +01:00
add /status/all-channels/pubkeys endpoint
This commit is contained in:
@@ -11,7 +11,9 @@ import org.springframework.test.web.servlet.MockMvc;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static de.cotto.lndmanagej.model.CoopClosedChannelFixtures.CLOSED_CHANNEL;
|
||||
import static de.cotto.lndmanagej.model.LocalOpenChannelFixtures.LOCAL_OPEN_CHANNEL;
|
||||
import static de.cotto.lndmanagej.model.LocalOpenChannelFixtures.LOCAL_OPEN_CHANNEL_TO_NODE_3;
|
||||
import static org.hamcrest.core.Is.is;
|
||||
@@ -54,4 +56,15 @@ class StatusControllerIT {
|
||||
mockMvc.perform(get(PREFIX + "/open-channels/pubkeys"))
|
||||
.andExpect(jsonPath("$.pubkeys", is(sortedPubkeys)));
|
||||
}
|
||||
|
||||
@Test
|
||||
void getPubkeysForAllChannels() throws Exception {
|
||||
when(channelService.getAllLocalChannels()).thenReturn(Stream.of(LOCAL_OPEN_CHANNEL_TO_NODE_3, CLOSED_CHANNEL));
|
||||
List<String> sortedPubkeys = List.of(
|
||||
CLOSED_CHANNEL.getRemotePubkey().toString(),
|
||||
LOCAL_OPEN_CHANNEL_TO_NODE_3.getRemotePubkey().toString()
|
||||
);
|
||||
mockMvc.perform(get(PREFIX + "/all-channels/pubkeys"))
|
||||
.andExpect(jsonPath("$.pubkeys", is(sortedPubkeys)));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user