mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2026-01-22 23:44:21 +01:00
add /balance endpoint for channels
This commit is contained in:
@@ -104,6 +104,18 @@ class ChannelControllerIT {
|
||||
.andExpect(status().isNotFound());
|
||||
}
|
||||
|
||||
@Test
|
||||
void getBalance() throws Exception {
|
||||
when(balanceService.getBalanceInformation(CHANNEL_ID)).thenReturn(Optional.of(BALANCE_INFORMATION_2));
|
||||
mockMvc.perform(get(CHANNEL_PREFIX + "/balance"))
|
||||
.andExpect(jsonPath("$.localBalance", is("2000")))
|
||||
.andExpect(jsonPath("$.localReserve", is("200")))
|
||||
.andExpect(jsonPath("$.localAvailable", is("1800")))
|
||||
.andExpect(jsonPath("$.remoteBalance", is("223")))
|
||||
.andExpect(jsonPath("$.remoteReserve", is("20")))
|
||||
.andExpect(jsonPath("$.remoteAvailable", is("203")));
|
||||
}
|
||||
|
||||
@Test
|
||||
void getFeeConfiguration() throws Exception {
|
||||
when(channelService.getLocalChannel(CHANNEL_ID)).thenReturn(Optional.of(LOCAL_OPEN_CHANNEL));
|
||||
|
||||
Reference in New Issue
Block a user