use of io.nem.symbol.sdk.openapi.vertx.model.NodeInfoDTO in project nem2-sdk-java by nemtech.
the class NodeRepositoryOkVertxImplTest method shouldGetNode.
@Test
public void shouldGetNode() throws Exception {
NodeInfoDTO dto = new NodeInfoDTO();
dto.setPort(3000);
dto.setHost("http://hostname");
dto.setFriendlyName("friendlyName");
dto.setNetworkIdentifier(104);
dto.setRoles(2);
dto.setVersion(1234);
dto.setPublicKey("somePublicKey");
dto.setNetworkGenerationHashSeed("abc");
mockRemoteCall(dto);
NodeInfo info = repository.getNodeInfo().toFuture().get();
Assertions.assertNotNull(info);
Assertions.assertEquals(dto.getPort().intValue(), info.getPort());
Assertions.assertEquals(dto.getHost(), info.getHost());
Assertions.assertEquals(dto.getPublicKey(), info.getPublicKey());
Assertions.assertEquals(dto.getFriendlyName(), info.getFriendlyName());
Assertions.assertEquals(NetworkType.MAIN_NET, info.getNetworkIdentifier());
Assertions.assertEquals(Collections.singletonList(RoleType.API_NODE), info.getRoles());
Assertions.assertEquals(dto.getVersion().intValue(), info.getVersion());
Assertions.assertEquals(dto.getNetworkGenerationHashSeed(), info.getNetworkGenerationHashSeed());
}
use of io.nem.symbol.sdk.openapi.vertx.model.NodeInfoDTO in project nem2-sdk-java by nemtech.
the class NetworkRepositoryVertxImplTest method shouldGetNetworkType.
@Test
void shouldGetNetworkType() throws Exception {
NodeInfoDTO dto = new NodeInfoDTO();
dto.setNetworkIdentifier(NetworkType.MIJIN_TEST.getValue());
mockRemoteCall(dto);
NetworkType info = repository.getNetworkType().toFuture().get();
Assertions.assertNotNull(info);
Assertions.assertEquals(NetworkType.MIJIN_TEST, info);
}
use of io.nem.symbol.sdk.openapi.vertx.model.NodeInfoDTO in project nem2-sdk-java by nemtech.
the class NodeRepositoryOkVertxImplTest method getNodePeers.
@Test
public void getNodePeers() throws Exception {
NodeInfoDTO dto = new NodeInfoDTO();
dto.setPort(3000);
dto.setHost("http://hostname");
dto.setFriendlyName("friendlyName");
dto.setNetworkIdentifier(104);
dto.setRoles(2);
dto.setVersion(1234);
dto.setPublicKey("somePublicKey");
dto.setNetworkGenerationHashSeed("abc");
mockRemoteCall(Arrays.asList(dto));
NodeInfo info = repository.getNodePeers().toFuture().get().get(0);
Assertions.assertNotNull(info);
Assertions.assertEquals(dto.getPort().intValue(), info.getPort());
Assertions.assertEquals(dto.getHost(), info.getHost());
Assertions.assertEquals(dto.getPublicKey(), info.getPublicKey());
Assertions.assertEquals(dto.getFriendlyName(), info.getFriendlyName());
Assertions.assertEquals(NetworkType.MAIN_NET, info.getNetworkIdentifier());
Assertions.assertEquals(Collections.singletonList(RoleType.API_NODE), info.getRoles());
Assertions.assertEquals(dto.getVersion().intValue(), info.getVersion());
Assertions.assertEquals(dto.getNetworkGenerationHashSeed(), info.getNetworkGenerationHashSeed());
}
Aggregations