mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2026-01-22 15:35:10 +01:00
warn if peer has no flow for >= 14 days
This commit is contained in:
@@ -9,10 +9,10 @@ import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
|
||||
import org.springframework.boot.test.mock.mockito.MockBean;
|
||||
import org.springframework.test.web.servlet.MockMvc;
|
||||
|
||||
import static de.cotto.lndmanagej.model.NodeWarningsFixtures.NODE_WARNINGS;
|
||||
import static de.cotto.lndmanagej.model.PubkeyFixtures.PUBKEY;
|
||||
import static de.cotto.lndmanagej.model.warnings.NodeWarningsFixtures.NODE_WARNINGS;
|
||||
import static org.hamcrest.Matchers.containsInAnyOrder;
|
||||
import static org.hamcrest.Matchers.hasSize;
|
||||
import static org.hamcrest.core.Is.is;
|
||||
import static org.mockito.Mockito.when;
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
|
||||
@@ -35,7 +35,11 @@ class WarningsControllerIT {
|
||||
void getWarningsForNode() throws Exception {
|
||||
when(nodeWarningsService.getNodeWarnings(PUBKEY)).thenReturn(NODE_WARNINGS);
|
||||
mockMvc.perform(get(NODE_PREFIX + "/warnings"))
|
||||
.andExpect(jsonPath("$.nodeWarnings[0].onlinePercentage", is(51)));
|
||||
.andExpect(jsonPath("$.nodeWarnings", containsInAnyOrder(
|
||||
"No flow in the past 16 days",
|
||||
"Node has been online 51% in the last week",
|
||||
"Node changed between online and offline 123 times"
|
||||
)));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user