diff --git a/application/src/integrationTest/java/de/cotto/lndmanagej/controller/LegacyControllerIT.java b/application/src/integrationTest/java/de/cotto/lndmanagej/controller/LegacyControllerIT.java index 19cc8d91..6a080123 100644 --- a/application/src/integrationTest/java/de/cotto/lndmanagej/controller/LegacyControllerIT.java +++ b/application/src/integrationTest/java/de/cotto/lndmanagej/controller/LegacyControllerIT.java @@ -6,7 +6,6 @@ import de.cotto.lndmanagej.service.BalanceService; import de.cotto.lndmanagej.service.ChannelService; import de.cotto.lndmanagej.service.FeeService; import de.cotto.lndmanagej.service.NodeService; -import de.cotto.lndmanagej.service.OwnNodeService; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; @@ -51,9 +50,6 @@ class LegacyControllerIT { @MockBean private ChannelService channelService; - @MockBean - private OwnNodeService ownNodeService; - @MockBean private FeeService feeService; @@ -114,18 +110,6 @@ class LegacyControllerIT { .andExpect(content().string(CHANNEL_ID + "\n" + CHANNEL_ID_3)); } - @Test - void isSyncedToChain_true() throws Exception { - when(ownNodeService.isSyncedToChain()).thenReturn(true); - mockMvc.perform(get("/legacy/synced-to-chain")).andExpect(content().string("true")); - } - - @Test - void isSyncedToChain_false() throws Exception { - when(ownNodeService.isSyncedToChain()).thenReturn(false); - mockMvc.perform(get("/legacy/synced-to-chain")).andExpect(content().string("false")); - } - @Test void getPeerPubkeys() throws Exception { when(channelService.getOpenChannels()).thenReturn(Set.of(LOCAL_OPEN_CHANNEL, LOCAL_OPEN_CHANNEL_TO_NODE_3)); diff --git a/application/src/main/java/de/cotto/lndmanagej/controller/LegacyController.java b/application/src/main/java/de/cotto/lndmanagej/controller/LegacyController.java index eb076e27..a9e542c8 100644 --- a/application/src/main/java/de/cotto/lndmanagej/controller/LegacyController.java +++ b/application/src/main/java/de/cotto/lndmanagej/controller/LegacyController.java @@ -10,7 +10,6 @@ import de.cotto.lndmanagej.service.BalanceService; import de.cotto.lndmanagej.service.ChannelService; import de.cotto.lndmanagej.service.FeeService; import de.cotto.lndmanagej.service.NodeService; -import de.cotto.lndmanagej.service.OwnNodeService; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; @@ -26,7 +25,6 @@ public class LegacyController { private static final String NEWLINE = "\n"; private final NodeService nodeService; private final ChannelService channelService; - private final OwnNodeService ownNodeService; private final FeeService feeService; private final BalanceService balanceService; private final Metrics metrics; @@ -34,14 +32,12 @@ public class LegacyController { public LegacyController( NodeService nodeService, ChannelService channelService, - OwnNodeService ownNodeService, FeeService feeService, BalanceService balanceService, Metrics metrics ) { this.nodeService = nodeService; this.channelService = channelService; - this.ownNodeService = ownNodeService; this.feeService = feeService; this.balanceService = balanceService; this.metrics = metrics; @@ -127,12 +123,6 @@ public class LegacyController { .collect(Collectors.joining(NEWLINE)); } - @GetMapping("/synced-to-chain") - public boolean syncedToChain() { - mark("syncedToChain"); - return ownNodeService.isSyncedToChain(); - } - @GetMapping("/channel/{channelId}/incoming-fee-rate") public long getIncomingFeeRate(@PathVariable ChannelId channelId) { mark("getIncomingFeeRate"); diff --git a/application/src/test/java/de/cotto/lndmanagej/controller/LegacyControllerTest.java b/application/src/test/java/de/cotto/lndmanagej/controller/LegacyControllerTest.java index 109d0e08..86f94686 100644 --- a/application/src/test/java/de/cotto/lndmanagej/controller/LegacyControllerTest.java +++ b/application/src/test/java/de/cotto/lndmanagej/controller/LegacyControllerTest.java @@ -6,7 +6,6 @@ import de.cotto.lndmanagej.service.BalanceService; import de.cotto.lndmanagej.service.ChannelService; import de.cotto.lndmanagej.service.FeeService; import de.cotto.lndmanagej.service.NodeService; -import de.cotto.lndmanagej.service.OwnNodeService; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; @@ -51,9 +50,6 @@ class LegacyControllerTest { @Mock private ChannelService channelService; - @Mock - private OwnNodeService ownNodeService; - @Mock private FeeService feeService; @@ -178,19 +174,6 @@ class LegacyControllerTest { ); } - @Test - void syncedToChain() { - when(ownNodeService.isSyncedToChain()).thenReturn(true); - assertThat(legacyController.syncedToChain()).isTrue(); - verify(metrics).mark(argThat(name -> name.endsWith(".syncedToChain"))); - } - - @Test - void syncedToChain_false() { - when(ownNodeService.isSyncedToChain()).thenReturn(false); - assertThat(legacyController.syncedToChain()).isFalse(); - } - @Test void getPeerPubkeys() { when(channelService.getOpenChannels()).thenReturn(Set.of(LOCAL_OPEN_CHANNEL, LOCAL_OPEN_CHANNEL_TO_NODE_3));