mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2026-01-24 16:34:19 +01:00
@@ -93,9 +93,9 @@ class ChannelControllerIT {
|
||||
.andExpect(jsonPath("$.channelIdCompactLnd", is(CHANNEL_ID_2.getCompactFormLnd())))
|
||||
.andExpect(jsonPath("$.channelPoint", is(CHANNEL_POINT.toString())))
|
||||
.andExpect(jsonPath("$.remotePubkey", is(PUBKEY_2.toString())))
|
||||
.andExpect(jsonPath("$.capacity", is(String.valueOf(CAPACITY.satoshis()))))
|
||||
.andExpect(jsonPath("$.totalSent", is(String.valueOf(TOTAL_SENT_2.satoshis()))))
|
||||
.andExpect(jsonPath("$.totalReceived", is(String.valueOf(TOTAL_RECEIVED_2.satoshis()))))
|
||||
.andExpect(jsonPath("$.capacitySat", is(String.valueOf(CAPACITY.satoshis()))))
|
||||
.andExpect(jsonPath("$.totalSentSat", is(String.valueOf(TOTAL_SENT_2.satoshis()))))
|
||||
.andExpect(jsonPath("$.totalReceivedSat", is(String.valueOf(TOTAL_RECEIVED_2.satoshis()))))
|
||||
.andExpect(jsonPath("$.openInitiator", is("REMOTE")))
|
||||
.andExpect(jsonPath("$.openHeight", is(CHANNEL_ID_2.getBlockHeight())))
|
||||
.andExpect(jsonPath("$.status.private", is(false)))
|
||||
@@ -109,8 +109,8 @@ class ChannelControllerIT {
|
||||
void getBasicInformation_closed_channel() throws Exception {
|
||||
when(channelService.getLocalChannel(CHANNEL_ID)).thenReturn(Optional.of(CLOSED_CHANNEL));
|
||||
mockMvc.perform(get(CHANNEL_PREFIX + "/"))
|
||||
.andExpect(jsonPath("$.totalSent", is("0")))
|
||||
.andExpect(jsonPath("$.totalReceived", is("0")))
|
||||
.andExpect(jsonPath("$.totalSentSat", is("0")))
|
||||
.andExpect(jsonPath("$.totalReceivedSat", is("0")))
|
||||
.andExpect(jsonPath("$.closeDetails.initiator", is("REMOTE")))
|
||||
.andExpect(jsonPath("$.closeDetails.height", is(600_000)))
|
||||
.andExpect(jsonPath("$.status.active", is(false)))
|
||||
@@ -134,9 +134,9 @@ class ChannelControllerIT {
|
||||
.andExpect(jsonPath("$.channelPoint", is(CHANNEL_POINT.toString())))
|
||||
.andExpect(jsonPath("$.remotePubkey", is(PUBKEY_2.toString())))
|
||||
.andExpect(jsonPath("$.remoteAlias", is(ALIAS)))
|
||||
.andExpect(jsonPath("$.capacity", is(String.valueOf(CAPACITY.satoshis()))))
|
||||
.andExpect(jsonPath("$.totalSent", is(String.valueOf(TOTAL_SENT.satoshis()))))
|
||||
.andExpect(jsonPath("$.totalReceived", is(String.valueOf(TOTAL_RECEIVED.satoshis()))))
|
||||
.andExpect(jsonPath("$.capacitySat", is(String.valueOf(CAPACITY.satoshis()))))
|
||||
.andExpect(jsonPath("$.totalSentSat", is(String.valueOf(TOTAL_SENT.satoshis()))))
|
||||
.andExpect(jsonPath("$.totalReceivedSat", is(String.valueOf(TOTAL_RECEIVED.satoshis()))))
|
||||
.andExpect(jsonPath("$.openInitiator", is("LOCAL")))
|
||||
.andExpect(jsonPath("$.openHeight", is(CHANNEL_ID.getBlockHeight())))
|
||||
.andExpect(jsonPath("$.status.private", is(true)))
|
||||
@@ -144,40 +144,40 @@ class ChannelControllerIT {
|
||||
.andExpect(jsonPath("$.status.closed", is(false)))
|
||||
.andExpect(jsonPath("$.status.openClosed", is("OPEN")))
|
||||
.andExpect(jsonPath("$.numUpdates", is(NUM_UPDATES)))
|
||||
.andExpect(jsonPath("$.onChainCosts.openCosts", is("1000")))
|
||||
.andExpect(jsonPath("$.onChainCosts.closeCosts", is("2000")))
|
||||
.andExpect(jsonPath("$.onChainCosts.sweepCosts", is("3000")))
|
||||
.andExpect(jsonPath("$.onChainCosts.openCostsSat", is("1000")))
|
||||
.andExpect(jsonPath("$.onChainCosts.closeCostsSat", is("2000")))
|
||||
.andExpect(jsonPath("$.onChainCosts.sweepCostsSat", is("3000")))
|
||||
.andExpect(jsonPath("$.rebalanceReport.sourceCosts", is("1001000")))
|
||||
.andExpect(jsonPath("$.rebalanceReport.sourceAmount", is("666000")))
|
||||
.andExpect(jsonPath("$.rebalanceReport.targetCosts", is("2001000")))
|
||||
.andExpect(jsonPath("$.rebalanceReport.targetAmount", is("992000")))
|
||||
.andExpect(jsonPath("$.rebalanceReport.supportAsSourceAmount", is("101000")))
|
||||
.andExpect(jsonPath("$.rebalanceReport.supportAsTargetAmount", is("201000")))
|
||||
.andExpect(jsonPath("$.balance.localBalance", is("1000")))
|
||||
.andExpect(jsonPath("$.balance.localReserve", is("100")))
|
||||
.andExpect(jsonPath("$.balance.localAvailable", is("900")))
|
||||
.andExpect(jsonPath("$.balance.remoteBalance", is("123")))
|
||||
.andExpect(jsonPath("$.balance.remoteReserve", is("10")))
|
||||
.andExpect(jsonPath("$.balance.remoteAvailable", is("113")))
|
||||
.andExpect(jsonPath("$.balance.localBalanceSat", is("1000")))
|
||||
.andExpect(jsonPath("$.balance.localReserveSat", is("100")))
|
||||
.andExpect(jsonPath("$.balance.localAvailableSat", is("900")))
|
||||
.andExpect(jsonPath("$.balance.remoteBalanceSat", is("123")))
|
||||
.andExpect(jsonPath("$.balance.remoteReserveSat", is("10")))
|
||||
.andExpect(jsonPath("$.balance.remoteAvailableSat", is("113")))
|
||||
.andExpect(jsonPath("$.policies.local.enabled", is(false)))
|
||||
.andExpect(jsonPath("$.policies.remote.enabled", is(true)))
|
||||
.andExpect(jsonPath("$.policies.local.feeRatePpm", is(100)))
|
||||
.andExpect(jsonPath("$.policies.local.baseFeeMilliSat", is(10)))
|
||||
.andExpect(jsonPath("$.policies.remote.feeRatePpm", is(222)))
|
||||
.andExpect(jsonPath("$.policies.remote.baseFeeMilliSat", is(0)))
|
||||
.andExpect(jsonPath("$.feeReport.earned", is("1234")))
|
||||
.andExpect(jsonPath("$.feeReport.sourced", is("567")))
|
||||
.andExpect(jsonPath("$.flowReport.forwardedSent", is("1000")))
|
||||
.andExpect(jsonPath("$.flowReport.forwardedReceived", is("2000")))
|
||||
.andExpect(jsonPath("$.flowReport.forwardingFeesReceived", is("10")))
|
||||
.andExpect(jsonPath("$.flowReport.rebalanceSent", is("60000")))
|
||||
.andExpect(jsonPath("$.flowReport.rebalanceFeesSent", is("4")))
|
||||
.andExpect(jsonPath("$.flowReport.rebalanceReceived", is("61000")))
|
||||
.andExpect(jsonPath("$.flowReport.rebalanceSupportSent", is("9000")))
|
||||
.andExpect(jsonPath("$.flowReport.rebalanceSupportFeesSent", is("2")))
|
||||
.andExpect(jsonPath("$.flowReport.rebalanceSupportReceived", is("10")))
|
||||
.andExpect(jsonPath("$.flowReport.totalSent", is("70006")))
|
||||
.andExpect(jsonPath("$.flowReport.totalReceived", is("63020")))
|
||||
.andExpect(jsonPath("$.feeReport.earnedMilliSat", is("1234")))
|
||||
.andExpect(jsonPath("$.feeReport.sourcedMilliSat", is("567")))
|
||||
.andExpect(jsonPath("$.flowReport.forwardedSentMilliSat", is("1000")))
|
||||
.andExpect(jsonPath("$.flowReport.forwardedReceivedMilliSat", is("2000")))
|
||||
.andExpect(jsonPath("$.flowReport.forwardingFeesReceivedMilliSat", is("10")))
|
||||
.andExpect(jsonPath("$.flowReport.rebalanceSentMilliSat", is("60000")))
|
||||
.andExpect(jsonPath("$.flowReport.rebalanceFeesSentMilliSat", is("4")))
|
||||
.andExpect(jsonPath("$.flowReport.rebalanceReceivedMilliSat", is("61000")))
|
||||
.andExpect(jsonPath("$.flowReport.rebalanceSupportSentMilliSat", is("9000")))
|
||||
.andExpect(jsonPath("$.flowReport.rebalanceSupportFeesSentMilliSat", is("2")))
|
||||
.andExpect(jsonPath("$.flowReport.rebalanceSupportReceivedMilliSat", is("10")))
|
||||
.andExpect(jsonPath("$.flowReport.totalSentMilliSat", is("70006")))
|
||||
.andExpect(jsonPath("$.flowReport.totalReceivedMilliSat", is("63020")))
|
||||
.andExpect(jsonPath("$.warnings", containsInAnyOrder(
|
||||
"Channel has accumulated 101,000 updates"
|
||||
)));
|
||||
@@ -191,16 +191,16 @@ class ChannelControllerIT {
|
||||
.andExpect(jsonPath("$.closeDetails.initiator", is("REMOTE")))
|
||||
.andExpect(jsonPath("$.closeDetails.height", is(600_000)))
|
||||
.andExpect(jsonPath("$.status.openClosed", is("CLOSED")))
|
||||
.andExpect(jsonPath("$.totalSent", is("0")))
|
||||
.andExpect(jsonPath("$.totalReceived", is("0")))
|
||||
.andExpect(jsonPath("$.totalSentSat", is("0")))
|
||||
.andExpect(jsonPath("$.totalReceivedSat", is("0")))
|
||||
.andExpect(jsonPath("$.status.active", is(false)))
|
||||
.andExpect(jsonPath("$.status.closed", is(true)))
|
||||
.andExpect(jsonPath("$.balance.localBalance", is("0")))
|
||||
.andExpect(jsonPath("$.balance.localReserve", is("0")))
|
||||
.andExpect(jsonPath("$.balance.localAvailable", is("0")))
|
||||
.andExpect(jsonPath("$.balance.remoteBalance", is("0")))
|
||||
.andExpect(jsonPath("$.balance.remoteReserve", is("0")))
|
||||
.andExpect(jsonPath("$.balance.remoteAvailable", is("0")))
|
||||
.andExpect(jsonPath("$.balance.localBalanceSat", is("0")))
|
||||
.andExpect(jsonPath("$.balance.localReserveSat", is("0")))
|
||||
.andExpect(jsonPath("$.balance.localAvailableSat", is("0")))
|
||||
.andExpect(jsonPath("$.balance.remoteBalanceSat", is("0")))
|
||||
.andExpect(jsonPath("$.balance.remoteReserveSat", is("0")))
|
||||
.andExpect(jsonPath("$.balance.remoteAvailableSat", is("0")))
|
||||
.andExpect(jsonPath("$.policies.local.enabled", is(false)))
|
||||
.andExpect(jsonPath("$.policies.remote.enabled", is(false)));
|
||||
}
|
||||
@@ -216,12 +216,12 @@ class ChannelControllerIT {
|
||||
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")));
|
||||
.andExpect(jsonPath("$.localBalanceSat", is("2000")))
|
||||
.andExpect(jsonPath("$.localReserveSat", is("200")))
|
||||
.andExpect(jsonPath("$.localAvailableSat", is("1800")))
|
||||
.andExpect(jsonPath("$.remoteBalanceSat", is("223")))
|
||||
.andExpect(jsonPath("$.remoteReserveSat", is("20")))
|
||||
.andExpect(jsonPath("$.remoteAvailableSat", is("203")));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -271,7 +271,7 @@ class ChannelControllerIT {
|
||||
void getFeeReport() throws Exception {
|
||||
when(feeService.getFeeReportForChannel(CHANNEL_ID)).thenReturn(FEE_REPORT);
|
||||
mockMvc.perform(get(CHANNEL_PREFIX + "/fee-report"))
|
||||
.andExpect(jsonPath("$.earned", is("1234")))
|
||||
.andExpect(jsonPath("$.sourced", is("567")));
|
||||
.andExpect(jsonPath("$.earnedMilliSat", is("1234")))
|
||||
.andExpect(jsonPath("$.sourcedMilliSat", is("567")));
|
||||
}
|
||||
}
|
||||
@@ -39,17 +39,17 @@ class FlowControllerIT {
|
||||
void getFlowReport_for_channel() throws Exception {
|
||||
when(flowService.getFlowReportForChannel(CHANNEL_ID)).thenReturn(FLOW_REPORT_2);
|
||||
mockMvc.perform(get(CHANNEL_PREFIX + "/flow-report"))
|
||||
.andExpect(jsonPath("$.forwardedSent", is("1000")))
|
||||
.andExpect(jsonPath("$.forwardedReceived", is("2000")))
|
||||
.andExpect(jsonPath("$.forwardingFeesReceived", is("10")))
|
||||
.andExpect(jsonPath("$.rebalanceSent", is("60000")))
|
||||
.andExpect(jsonPath("$.rebalanceFeesSent", is("4")))
|
||||
.andExpect(jsonPath("$.rebalanceReceived", is("61000")))
|
||||
.andExpect(jsonPath("$.rebalanceSupportSent", is("9000")))
|
||||
.andExpect(jsonPath("$.rebalanceSupportFeesSent", is("2")))
|
||||
.andExpect(jsonPath("$.rebalanceSupportReceived", is("10")))
|
||||
.andExpect(jsonPath("$.totalSent", is("70006")))
|
||||
.andExpect(jsonPath("$.totalReceived", is("63020")));
|
||||
.andExpect(jsonPath("$.forwardedSentMilliSat", is("1000")))
|
||||
.andExpect(jsonPath("$.forwardedReceivedMilliSat", is("2000")))
|
||||
.andExpect(jsonPath("$.forwardingFeesReceivedMilliSat", is("10")))
|
||||
.andExpect(jsonPath("$.rebalanceSentMilliSat", is("60000")))
|
||||
.andExpect(jsonPath("$.rebalanceFeesSentMilliSat", is("4")))
|
||||
.andExpect(jsonPath("$.rebalanceReceivedMilliSat", is("61000")))
|
||||
.andExpect(jsonPath("$.rebalanceSupportSentMilliSat", is("9000")))
|
||||
.andExpect(jsonPath("$.rebalanceSupportFeesSentMilliSat", is("2")))
|
||||
.andExpect(jsonPath("$.rebalanceSupportReceivedMilliSat", is("10")))
|
||||
.andExpect(jsonPath("$.totalSentMilliSat", is("70006")))
|
||||
.andExpect(jsonPath("$.totalReceivedMilliSat", is("63020")));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -63,17 +63,17 @@ class FlowControllerIT {
|
||||
void getFlowReport_for_peer() throws Exception {
|
||||
when(flowService.getFlowReportForPeer(PUBKEY)).thenReturn(FLOW_REPORT);
|
||||
mockMvc.perform(get(NODE_PREFIX + "/flow-report"))
|
||||
.andExpect(jsonPath("$.forwardedSent", is("1050000")))
|
||||
.andExpect(jsonPath("$.forwardedReceived", is("9001000")))
|
||||
.andExpect(jsonPath("$.forwardingFeesReceived", is("1")))
|
||||
.andExpect(jsonPath("$.rebalanceSent", is("50000")))
|
||||
.andExpect(jsonPath("$.rebalanceFeesSent", is("5")))
|
||||
.andExpect(jsonPath("$.rebalanceReceived", is("51000")))
|
||||
.andExpect(jsonPath("$.rebalanceSupportSent", is("123")))
|
||||
.andExpect(jsonPath("$.rebalanceSupportFeesSent", is("1")))
|
||||
.andExpect(jsonPath("$.rebalanceSupportReceived", is("456")))
|
||||
.andExpect(jsonPath("$.totalSent", is("1100129")))
|
||||
.andExpect(jsonPath("$.totalReceived", is("9052457")));
|
||||
.andExpect(jsonPath("$.forwardedSentMilliSat", is("1050000")))
|
||||
.andExpect(jsonPath("$.forwardedReceivedMilliSat", is("9001000")))
|
||||
.andExpect(jsonPath("$.forwardingFeesReceivedMilliSat", is("1")))
|
||||
.andExpect(jsonPath("$.rebalanceSentMilliSat", is("50000")))
|
||||
.andExpect(jsonPath("$.rebalanceFeesSentMilliSat", is("5")))
|
||||
.andExpect(jsonPath("$.rebalanceReceivedMilliSat", is("51000")))
|
||||
.andExpect(jsonPath("$.rebalanceSupportSentMilliSat", is("123")))
|
||||
.andExpect(jsonPath("$.rebalanceSupportFeesSentMilliSat", is("1")))
|
||||
.andExpect(jsonPath("$.rebalanceSupportReceivedMilliSat", is("456")))
|
||||
.andExpect(jsonPath("$.totalSentMilliSat", is("1100129")))
|
||||
.andExpect(jsonPath("$.totalReceivedMilliSat", is("9052457")));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -91,33 +91,33 @@ class NodeControllerIT {
|
||||
.andExpect(jsonPath("$.rebalanceReport.targetAmount", is("991000")))
|
||||
.andExpect(jsonPath("$.rebalanceReport.supportAsSourceAmount", is("100000")))
|
||||
.andExpect(jsonPath("$.rebalanceReport.supportAsTargetAmount", is("200000")))
|
||||
.andExpect(jsonPath("$.flowReport.forwardedSent", is("1050000")))
|
||||
.andExpect(jsonPath("$.flowReport.forwardedReceived", is("9001000")))
|
||||
.andExpect(jsonPath("$.flowReport.forwardingFeesReceived", is("1")))
|
||||
.andExpect(jsonPath("$.flowReport.rebalanceSent", is("50000")))
|
||||
.andExpect(jsonPath("$.flowReport.rebalanceFeesSent", is("5")))
|
||||
.andExpect(jsonPath("$.flowReport.rebalanceReceived", is("51000")))
|
||||
.andExpect(jsonPath("$.flowReport.rebalanceSupportSent", is("123")))
|
||||
.andExpect(jsonPath("$.flowReport.rebalanceSupportFeesSent", is("1")))
|
||||
.andExpect(jsonPath("$.flowReport.rebalanceSupportReceived", is("456")))
|
||||
.andExpect(jsonPath("$.flowReport.totalSent", is("1100129")))
|
||||
.andExpect(jsonPath("$.flowReport.totalReceived", is("9052457")))
|
||||
.andExpect(jsonPath("$.balance.localBalance", is("2000")))
|
||||
.andExpect(jsonPath("$.balance.localReserve", is("200")))
|
||||
.andExpect(jsonPath("$.balance.localAvailable", is("1800")))
|
||||
.andExpect(jsonPath("$.balance.remoteBalance", is("223")))
|
||||
.andExpect(jsonPath("$.balance.remoteReserve", is("20")))
|
||||
.andExpect(jsonPath("$.balance.remoteAvailable", is("203")))
|
||||
.andExpect(jsonPath("$.feeReport.earned", is("1234")))
|
||||
.andExpect(jsonPath("$.feeReport.sourced", is("567")))
|
||||
.andExpect(jsonPath("$.flowReport.forwardedSentMilliSat", is("1050000")))
|
||||
.andExpect(jsonPath("$.flowReport.forwardedReceivedMilliSat", is("9001000")))
|
||||
.andExpect(jsonPath("$.flowReport.forwardingFeesReceivedMilliSat", is("1")))
|
||||
.andExpect(jsonPath("$.flowReport.rebalanceSentMilliSat", is("50000")))
|
||||
.andExpect(jsonPath("$.flowReport.rebalanceFeesSentMilliSat", is("5")))
|
||||
.andExpect(jsonPath("$.flowReport.rebalanceReceivedMilliSat", is("51000")))
|
||||
.andExpect(jsonPath("$.flowReport.rebalanceSupportSentMilliSat", is("123")))
|
||||
.andExpect(jsonPath("$.flowReport.rebalanceSupportFeesSentMilliSat", is("1")))
|
||||
.andExpect(jsonPath("$.flowReport.rebalanceSupportReceivedMilliSat", is("456")))
|
||||
.andExpect(jsonPath("$.flowReport.totalSentMilliSat", is("1100129")))
|
||||
.andExpect(jsonPath("$.flowReport.totalReceivedMilliSat", is("9052457")))
|
||||
.andExpect(jsonPath("$.balance.localBalanceSat", is("2000")))
|
||||
.andExpect(jsonPath("$.balance.localReserveSat", is("200")))
|
||||
.andExpect(jsonPath("$.balance.localAvailableSat", is("1800")))
|
||||
.andExpect(jsonPath("$.balance.remoteBalanceSat", is("223")))
|
||||
.andExpect(jsonPath("$.balance.remoteReserveSat", is("20")))
|
||||
.andExpect(jsonPath("$.balance.remoteAvailableSat", is("203")))
|
||||
.andExpect(jsonPath("$.feeReport.earnedMilliSat", is("1234")))
|
||||
.andExpect(jsonPath("$.feeReport.sourcedMilliSat", is("567")))
|
||||
.andExpect(jsonPath("$.warnings", containsInAnyOrder(
|
||||
"Node has been online 51% in the past 14 days",
|
||||
"Node changed between online and offline 123 times in the past 7 days",
|
||||
"No flow in the past 16 days"
|
||||
)))
|
||||
.andExpect(jsonPath("$.onChainCosts.openCosts", is("1000")))
|
||||
.andExpect(jsonPath("$.onChainCosts.closeCosts", is("2000")))
|
||||
.andExpect(jsonPath("$.onChainCosts.sweepCosts", is("3000")))
|
||||
.andExpect(jsonPath("$.onChainCosts.openCostsSat", is("1000")))
|
||||
.andExpect(jsonPath("$.onChainCosts.closeCostsSat", is("2000")))
|
||||
.andExpect(jsonPath("$.onChainCosts.sweepCostsSat", is("3000")))
|
||||
.andExpect(jsonPath("$.onlineReport.online", is(true)))
|
||||
.andExpect(jsonPath("$.onlineReport.onlinePercentage", is(77)))
|
||||
.andExpect(jsonPath("$.onlineReport.daysForOnlinePercentage", is(14)))
|
||||
@@ -148,27 +148,27 @@ class NodeControllerIT {
|
||||
void getBalance() throws Exception {
|
||||
when(balanceService.getBalanceInformationForPeer(PUBKEY)).thenReturn(BALANCE_INFORMATION);
|
||||
mockMvc.perform(get(NODE_PREFIX + "/balance"))
|
||||
.andExpect(jsonPath("$.localBalance", is("1000")))
|
||||
.andExpect(jsonPath("$.localReserve", is("100")))
|
||||
.andExpect(jsonPath("$.localAvailable", is("900")))
|
||||
.andExpect(jsonPath("$.remoteBalance", is("123")))
|
||||
.andExpect(jsonPath("$.remoteReserve", is("10")))
|
||||
.andExpect(jsonPath("$.remoteAvailable", is("113")));
|
||||
.andExpect(jsonPath("$.localBalanceSat", is("1000")))
|
||||
.andExpect(jsonPath("$.localReserveSat", is("100")))
|
||||
.andExpect(jsonPath("$.localAvailableSat", is("900")))
|
||||
.andExpect(jsonPath("$.remoteBalanceSat", is("123")))
|
||||
.andExpect(jsonPath("$.remoteReserveSat", is("10")))
|
||||
.andExpect(jsonPath("$.remoteAvailableSat", is("113")));
|
||||
}
|
||||
|
||||
@Test
|
||||
void getFeeReport() throws Exception {
|
||||
when(feeService.getFeeReportForPeer(PUBKEY)).thenReturn(FEE_REPORT);
|
||||
mockMvc.perform(get(NODE_PREFIX + "/fee-report"))
|
||||
.andExpect(jsonPath("$.earned", is("1234")))
|
||||
.andExpect(jsonPath("$.sourced", is("567")));
|
||||
.andExpect(jsonPath("$.earnedMilliSat", is("1234")))
|
||||
.andExpect(jsonPath("$.sourcedMilliSat", is("567")));
|
||||
}
|
||||
|
||||
@Test
|
||||
void getFeeReport_last_days() throws Exception {
|
||||
when(feeService.getFeeReportForPeer(PUBKEY, Duration.ofDays(123))).thenReturn(FEE_REPORT);
|
||||
mockMvc.perform(get(NODE_PREFIX + "/fee-report/last-days/123"))
|
||||
.andExpect(jsonPath("$.earned", is("1234")))
|
||||
.andExpect(jsonPath("$.sourced", is("567")));
|
||||
.andExpect(jsonPath("$.earnedMilliSat", is("1234")))
|
||||
.andExpect(jsonPath("$.sourcedMilliSat", is("567")));
|
||||
}
|
||||
}
|
||||
@@ -40,9 +40,9 @@ class OnChainCostsControllerIT {
|
||||
void on_chain_costs_for_peer() throws Exception {
|
||||
when(onChainCostService.getOnChainCostsForPeer(PUBKEY)).thenReturn(ON_CHAIN_COSTS);
|
||||
mockMvc.perform(get(PEER_PREFIX + "/on-chain-costs"))
|
||||
.andExpect(jsonPath("$.openCosts", is("1000")))
|
||||
.andExpect(jsonPath("$.closeCosts", is("2000")))
|
||||
.andExpect(jsonPath("$.sweepCosts", is("3000")));
|
||||
.andExpect(jsonPath("$.openCostsSat", is("1000")))
|
||||
.andExpect(jsonPath("$.closeCostsSat", is("2000")))
|
||||
.andExpect(jsonPath("$.sweepCostsSat", is("3000")));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -47,8 +47,8 @@ class SelfPaymentsControllerIT {
|
||||
mockMvc.perform(get(CHANNEL_PREFIX + "/self-payments-from-channel/"))
|
||||
.andExpect(jsonPath("$.selfPayments[0].memo", is(SELF_PAYMENT_2.memo())))
|
||||
.andExpect(jsonPath("$.selfPayments[1].memo", is(SELF_PAYMENT.memo())))
|
||||
.andExpect(jsonPath("$.fees", is("20")))
|
||||
.andExpect(jsonPath("$.amountPaid", is("4690")));
|
||||
.andExpect(jsonPath("$.feesMilliSat", is("20")))
|
||||
.andExpect(jsonPath("$.amountPaidMilliSat", is("4690")));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -58,8 +58,8 @@ class SelfPaymentsControllerIT {
|
||||
mockMvc.perform(get(NODE_PREFIX + "/self-payments-from-peer/"))
|
||||
.andExpect(jsonPath("$.selfPayments[0].memo", is(SELF_PAYMENT_2.memo())))
|
||||
.andExpect(jsonPath("$.selfPayments[1].memo", is(SELF_PAYMENT.memo())))
|
||||
.andExpect(jsonPath("$.fees", is("20")))
|
||||
.andExpect(jsonPath("$.amountPaid", is("4690")));
|
||||
.andExpect(jsonPath("$.feesMilliSat", is("20")))
|
||||
.andExpect(jsonPath("$.amountPaidMilliSat", is("4690")));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -69,18 +69,18 @@ class SelfPaymentsControllerIT {
|
||||
mockMvc.perform(get(CHANNEL_PREFIX + "/self-payments-to-channel/"))
|
||||
.andExpect(jsonPath("$.selfPayments[0].memo", is(SELF_PAYMENT.memo())))
|
||||
.andExpect(jsonPath("$.selfPayments[0].settleDate", is(SELF_PAYMENT.settleDate().toString())))
|
||||
.andExpect(jsonPath("$.selfPayments[0].amountPaid", is(msat(SELF_PAYMENT.amountPaid()))))
|
||||
.andExpect(jsonPath("$.selfPayments[0].fees", is(msat(SELF_PAYMENT.fees()))))
|
||||
.andExpect(jsonPath("$.selfPayments[0].amountPaidMilliSat", is(msat(SELF_PAYMENT.amountPaid()))))
|
||||
.andExpect(jsonPath("$.selfPayments[0].feesMilliSat", is(msat(SELF_PAYMENT.fees()))))
|
||||
.andExpect(jsonPath("$.selfPayments[0].firstChannel", is(CHANNEL_ID_4.toString())))
|
||||
.andExpect(jsonPath("$.selfPayments[0].lastChannel", is(CHANNEL_ID_2.toString())))
|
||||
.andExpect(jsonPath("$.selfPayments[1].memo", is(SELF_PAYMENT_2.memo())))
|
||||
.andExpect(jsonPath("$.selfPayments[1].settleDate", is(SELF_PAYMENT_2.settleDate().toString())))
|
||||
.andExpect(jsonPath("$.selfPayments[1].amountPaid", is(msat(SELF_PAYMENT_2.amountPaid()))))
|
||||
.andExpect(jsonPath("$.selfPayments[1].fees", is(msat(SELF_PAYMENT_2.fees()))))
|
||||
.andExpect(jsonPath("$.selfPayments[1].amountPaidMilliSat", is(msat(SELF_PAYMENT_2.amountPaid()))))
|
||||
.andExpect(jsonPath("$.selfPayments[1].feesMilliSat", is(msat(SELF_PAYMENT_2.fees()))))
|
||||
.andExpect(jsonPath("$.selfPayments[1].firstChannel", is(not(empty()))))
|
||||
.andExpect(jsonPath("$.selfPayments[1].lastChannel", is(CHANNEL_ID.toString())))
|
||||
.andExpect(jsonPath("$.fees", is("20")))
|
||||
.andExpect(jsonPath("$.amountPaid", is("4690")));
|
||||
.andExpect(jsonPath("$.feesMilliSat", is("20")))
|
||||
.andExpect(jsonPath("$.amountPaidMilliSat", is("4690")));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -90,8 +90,8 @@ class SelfPaymentsControllerIT {
|
||||
mockMvc.perform(get(NODE_PREFIX + "/self-payments-to-peer/"))
|
||||
.andExpect(jsonPath("$.selfPayments[0].memo", is(SELF_PAYMENT_2.memo())))
|
||||
.andExpect(jsonPath("$.selfPayments[1].memo", is(SELF_PAYMENT.memo())))
|
||||
.andExpect(jsonPath("$.fees", is("20")))
|
||||
.andExpect(jsonPath("$.amountPaid", is("4690")));
|
||||
.andExpect(jsonPath("$.feesMilliSat", is("20")))
|
||||
.andExpect(jsonPath("$.amountPaidMilliSat", is("4690")));
|
||||
}
|
||||
|
||||
private String msat(Coins value) {
|
||||
|
||||
Reference in New Issue
Block a user