mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2026-01-21 15:04:22 +01:00
fiq jq issue, use string instead of long
This commit is contained in:
@@ -43,7 +43,7 @@ class NodeControllerIT {
|
||||
void getOpenChannelIds() throws Exception {
|
||||
when(nodeService.getOpenChannelIds(PUBKEY)).thenReturn(List.of(CHANNEL_ID, CHANNEL_ID_3));
|
||||
mockMvc.perform(get("/api/node/" + PUBKEY + "/open-channels"))
|
||||
.andExpect(jsonPath("$[0]", is(CHANNEL_ID.shortChannelId())))
|
||||
.andExpect(jsonPath("$[1]", is(CHANNEL_ID_3.shortChannelId())));
|
||||
.andExpect(jsonPath("$[0]", is(CHANNEL_ID.toString())))
|
||||
.andExpect(jsonPath("$[1]", is(CHANNEL_ID_3.toString())));
|
||||
}
|
||||
}
|
||||
@@ -26,9 +26,9 @@ public class NodeController {
|
||||
}
|
||||
|
||||
@GetMapping("/open-channels")
|
||||
public List<Long> getOpenChannelIds(@PathVariable Pubkey pubkey) {
|
||||
public List<String> getOpenChannelIds(@PathVariable Pubkey pubkey) {
|
||||
return nodeService.getOpenChannelIds(pubkey).stream()
|
||||
.map(ChannelId::shortChannelId)
|
||||
.map(ChannelId::toString)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,10 +32,11 @@ class NodeControllerTest {
|
||||
|
||||
@Test
|
||||
void getOpenChannelIds() {
|
||||
// jq is confused by large numbers, return string instead
|
||||
when(nodeService.getOpenChannelIds(PUBKEY)).thenReturn(List.of(CHANNEL_ID, CHANNEL_ID_3));
|
||||
assertThat(nodeController.getOpenChannelIds(PUBKEY)).containsExactly(
|
||||
CHANNEL_ID.shortChannelId(),
|
||||
CHANNEL_ID_3.shortChannelId()
|
||||
CHANNEL_ID.toString(),
|
||||
CHANNEL_ID_3.toString()
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user