mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2026-01-27 09:54:51 +01:00
allow queries for channel ID in all supported formats
This commit is contained in:
committed by
Carsten Otto
parent
aa51837cd6
commit
0c69d9f9b2
@@ -19,8 +19,10 @@ import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import static de.cotto.lndmanagej.model.ChannelIdFixtures.CHANNEL_ID;
|
||||
import static de.cotto.lndmanagej.model.ChannelPointFixtures.CHANNEL_POINT;
|
||||
import static de.cotto.lndmanagej.ui.model.ChannelDetailsDtoFixture.CHANNEL_DETAILS_DTO;
|
||||
import static de.cotto.lndmanagej.ui.model.NodeDetailsDtoFixture.NODE_DETAILS_DTO;
|
||||
import static de.cotto.lndmanagej.ui.model.OpenChannelDtoFixture.OPEN_CHANNEL_DTO;
|
||||
@@ -68,6 +70,12 @@ class SearchControllerIT {
|
||||
searchForChannelId(CHANNEL_ID);
|
||||
}
|
||||
|
||||
@Test
|
||||
void searchForChannelId_viaChannelPoint_found() throws Exception {
|
||||
when(channelIdResolver.resolveFromChannelPoint(CHANNEL_POINT)).thenReturn(Optional.of(CHANNEL_ID));
|
||||
searchForChannelId(CHANNEL_POINT.toString());
|
||||
}
|
||||
|
||||
private void searchForChannelId(Object query) throws Exception {
|
||||
when(dataService.getOpenChannels()).thenReturn(
|
||||
List.of(openChannelDto(CHANNEL_DETAILS_DTO))
|
||||
|
||||
Reference in New Issue
Block a user