use of io.nem.symbol.sdk.openapi.vertx.model.AccountsNamesDTO 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());
}
Aggregations