Search in sources :

Example 1 with AccountNamesDTO

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

the class NamespaceRepositoryVertxImplTest method shouldGetAccountsNamesFromAddresses.

@Test
public void shouldGetAccountsNamesFromAddresses() throws Exception {
    Address address = Address.generateRandom(this.networkType);
    AccountNamesDTO dto = new AccountNamesDTO();
    dto.setAddress(encodeAddress(address));
    dto.setNames(Collections.singletonList("accountalias"));
    AccountsNamesDTO accountsNamesDTO = new AccountsNamesDTO();
    accountsNamesDTO.setAccountNames(Collections.singletonList(dto));
    mockRemoteCall(accountsNamesDTO);
    List<AccountNames> resolvedList = repository.getAccountsNames(Collections.singletonList(address)).toFuture().get();
    Assertions.assertEquals(1, resolvedList.size());
    AccountNames accountNames = resolvedList.get(0);
    Assertions.assertEquals(address, accountNames.getAddress());
    Assertions.assertEquals("accountalias", accountNames.getNames().get(0).getName());
}
Also used : AccountsNamesDTO(io.nem.symbol.sdk.openapi.vertx.model.AccountsNamesDTO) Address(io.nem.symbol.sdk.model.account.Address) AccountNamesDTO(io.nem.symbol.sdk.openapi.vertx.model.AccountNamesDTO) AccountNames(io.nem.symbol.sdk.model.account.AccountNames) Test(org.junit.jupiter.api.Test)

Aggregations

AccountNames (io.nem.symbol.sdk.model.account.AccountNames)1 Address (io.nem.symbol.sdk.model.account.Address)1 AccountNamesDTO (io.nem.symbol.sdk.openapi.vertx.model.AccountNamesDTO)1 AccountsNamesDTO (io.nem.symbol.sdk.openapi.vertx.model.AccountsNamesDTO)1 Test (org.junit.jupiter.api.Test)1