Search in sources :

Example 1 with NetworkConfigurationDTO

use of io.nem.symbol.sdk.openapi.vertx.model.NetworkConfigurationDTO in project nem2-sdk-java by nemtech.

the class NetworkRepositoryVertxImplTest method getNetworkProperties.

@Test
void getNetworkProperties() throws Exception {
    NetworkConfigurationDTO dto = TestHelperVertx.loadResource("network-configuration.json", NetworkConfigurationDTO.class);
    Assertions.assertNotNull(dto);
    ObjectNode plain = TestHelperVertx.loadResource("network-configuration.json", ObjectNode.class);
    Assertions.assertNotNull(plain);
    Assertions.assertEquals(jsonHelper.prettyPrint(dto), jsonHelper.prettyPrint(plain));
    mockRemoteCall(dto);
    NetworkConfiguration configuration = repository.getNetworkProperties().toFuture().get();
    Assertions.assertNotNull(configuration);
    Map sorted = TestHelperVertx.loadResource("network-configuration.json", Map.class);
    Assertions.assertNotNull(sorted);
    ((Map) sorted.get("network")).put("nodeEqualityStrategy", "PUBLIC_KEY");
    Assertions.assertEquals(jsonHelper.prettyPrint(sorted), jsonHelper.prettyPrint(configuration));
}
Also used : ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) NetworkConfigurationDTO(io.nem.symbol.sdk.openapi.vertx.model.NetworkConfigurationDTO) NetworkConfiguration(io.nem.symbol.sdk.model.network.NetworkConfiguration) Map(java.util.Map) Test(org.junit.jupiter.api.Test)

Aggregations

ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)1 NetworkConfiguration (io.nem.symbol.sdk.model.network.NetworkConfiguration)1 NetworkConfigurationDTO (io.nem.symbol.sdk.openapi.vertx.model.NetworkConfigurationDTO)1 Map (java.util.Map)1 Test (org.junit.jupiter.api.Test)1