mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2026-01-22 07:24:23 +01:00
add test
This commit is contained in:
@@ -6,6 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
|
||||
import org.springframework.boot.test.mock.mockito.MockBean;
|
||||
import org.springframework.test.web.servlet.MockMvc;
|
||||
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
|
||||
|
||||
import static de.cotto.lndmanagej.model.NodeFixtures.ALIAS;
|
||||
import static de.cotto.lndmanagej.model.NodeFixtures.NODE;
|
||||
@@ -27,4 +28,9 @@ class NodeControllerIT {
|
||||
when(grpcNodeInfo.getNode(PUBKEY)).thenReturn(NODE);
|
||||
mockMvc.perform(get("/api/node/" + PUBKEY + "/alias")).andExpect(content().string(ALIAS));
|
||||
}
|
||||
|
||||
@Test
|
||||
void getAlias_error() throws Exception {
|
||||
mockMvc.perform(get("/api/node/xxx/alias")).andExpect(MockMvcResultMatchers.status().isBadRequest());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user