add endpoint: get all channels for peer

This commit is contained in:
Carsten Otto
2021-11-27 17:35:54 +01:00
parent 280804587e
commit e61cfa6ee2
3 changed files with 31 additions and 0 deletions

View File

@@ -106,6 +106,15 @@ class NodeControllerIT {
.andExpect(jsonPath("$.channels", is(channelIds)));
}
@Test
void getAllChannelIds() throws Exception {
when(channelService.getAllChannelsWith(PUBKEY_2)).thenReturn(Set.of(LOCAL_OPEN_CHANNEL, CLOSED_CHANNEL_3));
List<String> channelIds = List.of(CHANNEL_ID.toString(), CHANNEL_ID_3.toString());
mockMvc.perform(get(NODE_PREFIX + "/all-channels"))
.andExpect(jsonPath("$.node", is(PUBKEY_2.toString())))
.andExpect(jsonPath("$.channels", is(channelIds)));
}
@Test
void getBalance() throws Exception {
when(balanceService.getBalanceInformation(PUBKEY_2)).thenReturn(BALANCE_INFORMATION);