add synced-to-chain endpoint

remove caching from GrpcGetInfo
use pubkey instead of node in channel model
This commit is contained in:
Carsten Otto
2021-11-12 11:38:36 +01:00
parent 3314a49c54
commit 9193353705
14 changed files with 227 additions and 170 deletions

View File

@@ -2,6 +2,7 @@ package de.cotto.lndmanagej.controller;
import de.cotto.lndmanagej.service.ChannelService;
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;
@@ -28,6 +29,9 @@ class LegacyControllerTest {
@Mock
private ChannelService channelService;
@Mock
private OwnNodeService ownNodeService;
@Test
void getAlias() {
when(nodeService.getAlias(PUBKEY)).thenReturn(ALIAS);
@@ -41,4 +45,16 @@ class LegacyControllerTest {
CHANNEL_ID + "\n" + CHANNEL_ID_3
);
}
@Test
void syncedToChain() {
when(ownNodeService.isSyncedToChain()).thenReturn(true);
assertThat(legacyController.syncedToChain()).isTrue();
}
@Test
void syncedToChain_false() {
when(ownNodeService.isSyncedToChain()).thenReturn(false);
assertThat(legacyController.syncedToChain()).isFalse();
}
}