Search in sources :

Example 1 with NetworkConfigurationDTO

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

the class NetworkRepositoryOkHttpImplTest method getNetworkProperties.

@Test
void getNetworkProperties() throws Exception {
    NetworkConfigurationDTO dto = TestHelperOkHttp.loadResource("network-configuration.json", NetworkConfigurationDTO.class);
    Assertions.assertNotNull(dto);
    JsonObject plain = TestHelperOkHttp.loadResource("network-configuration.json", JsonObject.class);
    Assertions.assertNotNull(plain);
    Assertions.assertEquals(jsonHelper.prettyPrint(dto), jsonHelper.prettyPrint(plain));
    mockRemoteCall(dto);
    NetworkConfiguration configuration = repository.getNetworkProperties().toFuture().get();
    Assertions.assertNotNull(configuration);
    plain.get("network").getAsJsonObject().addProperty("nodeEqualityStrategy", "PUBLIC_KEY");
    Assertions.assertEquals(jsonHelper.prettyPrint(plain), jsonHelper.prettyPrint(configuration));
}
Also used : JsonObject(com.google.gson.JsonObject) NetworkConfigurationDTO(io.nem.symbol.sdk.openapi.okhttp_gson.model.NetworkConfigurationDTO) NetworkConfiguration(io.nem.symbol.sdk.model.network.NetworkConfiguration) Test(org.junit.jupiter.api.Test)

Aggregations

JsonObject (com.google.gson.JsonObject)1 NetworkConfiguration (io.nem.symbol.sdk.model.network.NetworkConfiguration)1 NetworkConfigurationDTO (io.nem.symbol.sdk.openapi.okhttp_gson.model.NetworkConfigurationDTO)1 Test (org.junit.jupiter.api.Test)1