use /legacy/ instead of /api/

This commit is contained in:
Carsten Otto
2021-11-12 09:09:54 +01:00
parent 7bd5f8d406
commit bf18847a69
2 changed files with 4 additions and 4 deletions

View File

@@ -29,18 +29,18 @@ class LegacyControllerIT {
@Test
void getAlias() throws Exception {
when(nodeService.getAlias(PUBKEY)).thenReturn(ALIAS);
mockMvc.perform(get("/api/node/" + PUBKEY + "/alias")).andExpect(content().string(ALIAS));
mockMvc.perform(get("/legacy/node/" + PUBKEY + "/alias")).andExpect(content().string(ALIAS));
}
@Test
void getAlias_error() throws Exception {
mockMvc.perform(get("/api/node/xxx/alias")).andExpect(MockMvcResultMatchers.status().isBadRequest());
mockMvc.perform(get("/legacy/node/xxx/alias")).andExpect(MockMvcResultMatchers.status().isBadRequest());
}
@Test
void getOpenChannelIds() throws Exception {
when(nodeService.getOpenChannelIds(PUBKEY)).thenReturn(List.of(CHANNEL_ID, CHANNEL_ID_3));
mockMvc.perform(get("/api/node/" + PUBKEY + "/open-channels"))
mockMvc.perform(get("/legacy/node/" + PUBKEY + "/open-channels"))
.andExpect(content().string(CHANNEL_ID + "\n" + CHANNEL_ID_3));
}
}

View File

@@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.stream.Collectors;
@RestController
@RequestMapping("/api/node/{pubkey}/")
@RequestMapping("/legacy/node/{pubkey}/")
public class LegacyController {
private static final String NEWLINE = "\n";
private final NodeService nodeService;