remove legacy endpoint

This commit is contained in:
Carsten Otto
2021-11-27 17:39:13 +01:00
parent e61cfa6ee2
commit 05892ab376
3 changed files with 1 additions and 53 deletions

View File

@@ -11,21 +11,14 @@ import org.springframework.test.web.servlet.MockMvc;
import java.util.Set;
import static de.cotto.lndmanagej.model.ChannelIdFixtures.CHANNEL_ID;
import static de.cotto.lndmanagej.model.ChannelIdFixtures.CHANNEL_ID_3;
import static de.cotto.lndmanagej.model.CoopClosedChannelFixtures.CLOSED_CHANNEL_3;
import static de.cotto.lndmanagej.model.LocalOpenChannelFixtures.LOCAL_OPEN_CHANNEL;
import static de.cotto.lndmanagej.model.LocalOpenChannelFixtures.LOCAL_OPEN_CHANNEL_3;
import static de.cotto.lndmanagej.model.PubkeyFixtures.PUBKEY;
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.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@WebMvcTest(controllers = LegacyController.class)
class LegacyControllerIT {
private static final String PUBKEY_BASE = "/legacy/node/" + PUBKEY;
@Autowired
private MockMvc mockMvc;
@@ -40,13 +33,6 @@ class LegacyControllerIT {
@SuppressWarnings("unused")
private Metrics metrics;
@Test
void getAllChannelIds_for_peer() throws Exception {
when(channelService.getAllChannelsWith(PUBKEY)).thenReturn(Set.of(LOCAL_OPEN_CHANNEL, CLOSED_CHANNEL_3));
mockMvc.perform(get(PUBKEY_BASE + "/all-channels"))
.andExpect(content().string(CHANNEL_ID + "\n" + CHANNEL_ID_3));
}
@Test
void getOpenChannelIdsPretty() throws Exception {
when(channelService.getOpenChannels()).thenReturn(Set.of(LOCAL_OPEN_CHANNEL, LOCAL_OPEN_CHANNEL_3));