mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2026-01-24 00:14:25 +01:00
rename controller
This commit is contained in:
@@ -20,8 +20,8 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
|
||||
|
||||
@WebMvcTest(controllers = NodeController.class)
|
||||
class NodeControllerIT {
|
||||
@WebMvcTest(controllers = LegacyController.class)
|
||||
class LegacyControllerIT {
|
||||
@Autowired
|
||||
private MockMvc mockMvc;
|
||||
|
||||
@@ -13,10 +13,10 @@ import java.util.stream.Collectors;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/node/{pubkey}/")
|
||||
public class NodeController {
|
||||
public class LegacyController {
|
||||
private final NodeService nodeService;
|
||||
|
||||
public NodeController(NodeService nodeService) {
|
||||
public LegacyController(NodeService nodeService) {
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
@@ -17,9 +17,9 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
@ExtendWith({MockitoExtension.class})
|
||||
class NodeControllerTest {
|
||||
class LegacyControllerTest {
|
||||
@InjectMocks
|
||||
private NodeController nodeController;
|
||||
private LegacyController legacyController;
|
||||
|
||||
@Mock
|
||||
private NodeService nodeService;
|
||||
@@ -27,14 +27,14 @@ class NodeControllerTest {
|
||||
@Test
|
||||
void getAlias() {
|
||||
when(nodeService.getAlias(PUBKEY)).thenReturn(ALIAS);
|
||||
assertThat(nodeController.getAlias(PUBKEY)).isEqualTo(ALIAS);
|
||||
assertThat(legacyController.getAlias(PUBKEY)).isEqualTo(ALIAS);
|
||||
}
|
||||
|
||||
@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(
|
||||
assertThat(legacyController.getOpenChannelIds(PUBKEY)).containsExactly(
|
||||
CHANNEL_ID.toString(),
|
||||
CHANNEL_ID_3.toString()
|
||||
);
|
||||
Reference in New Issue
Block a user