mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2026-01-22 15:35:10 +01:00
accept channel ID in all supported formats
This commit is contained in:
committed by
Carsten Otto
parent
7a2afd71a2
commit
cf03cf259e
@@ -1,6 +1,6 @@
|
||||
package de.cotto.lndmanagej.ui;
|
||||
|
||||
import de.cotto.lndmanagej.controller.ChannelIdConverter;
|
||||
import de.cotto.lndmanagej.model.ChannelIdResolver;
|
||||
import de.cotto.lndmanagej.ui.controller.ChanDetailsController;
|
||||
import de.cotto.lndmanagej.ui.page.PageService;
|
||||
import de.cotto.lndmanagej.ui.page.channel.ChannelDetailsPage;
|
||||
@@ -9,11 +9,12 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
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 org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
|
||||
|
||||
import static de.cotto.lndmanagej.model.ChannelIdFixtures.CHANNEL_ID;
|
||||
import static de.cotto.lndmanagej.ui.model.ChanDetailsDtoFixture.CHAN_DETAILS_DTO;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.BDDMockito.given;
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
@WebMvcTest(controllers = ChanDetailsController.class)
|
||||
@@ -25,14 +26,14 @@ class ChanDetailsControllerTest {
|
||||
@MockBean
|
||||
private PageService pageService;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@MockBean
|
||||
private ChannelIdConverter channelIdConverter;
|
||||
@SuppressWarnings("unused")
|
||||
private ChannelIdResolver channelIdResolver;
|
||||
|
||||
@Test
|
||||
void testNodeDetailsPage() throws Exception {
|
||||
given(this.pageService.channelDetails(any())).willReturn(new ChannelDetailsPage(CHAN_DETAILS_DTO));
|
||||
mockMvc.perform(MockMvcRequestBuilders.get("/channel/783231610496155649"))
|
||||
given(pageService.channelDetails(any())).willReturn(new ChannelDetailsPage(CHAN_DETAILS_DTO));
|
||||
mockMvc.perform(get("/channel/" + CHANNEL_ID))
|
||||
.andExpect(status().isOk());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user