mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2026-01-21 23:14:27 +01:00
get available local balance
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package de.cotto.lndmanagej.controller;
|
||||
|
||||
import de.cotto.lndmanagej.model.Coins;
|
||||
import de.cotto.lndmanagej.service.BalanceService;
|
||||
import de.cotto.lndmanagej.service.ChannelService;
|
||||
import de.cotto.lndmanagej.service.FeeService;
|
||||
import de.cotto.lndmanagej.service.NodeService;
|
||||
@@ -51,6 +52,9 @@ class LegacyControllerIT {
|
||||
@MockBean
|
||||
private FeeService feeService;
|
||||
|
||||
@MockBean
|
||||
private BalanceService balanceService;
|
||||
|
||||
@Test
|
||||
void getAlias() throws Exception {
|
||||
when(nodeService.getAlias(PUBKEY)).thenReturn(ALIAS);
|
||||
@@ -136,4 +140,12 @@ class LegacyControllerIT {
|
||||
mockMvc.perform(get(CHANNEL_BASE + "/outgoing-base-fee"))
|
||||
.andExpect(content().string(String.valueOf(BASE_FEE.milliSatoshis())));
|
||||
}
|
||||
|
||||
@Test
|
||||
void getAvailableLocalBalance() throws Exception {
|
||||
Coins availableBalance = Coins.ofSatoshis(999);
|
||||
when(balanceService.getAvailableLocalBalance(CHANNEL_ID)).thenReturn(availableBalance);
|
||||
mockMvc.perform(get(CHANNEL_BASE + "/available-local-balance"))
|
||||
.andExpect(content().string(String.valueOf(availableBalance.satoshis())));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user