use of io.nem.symbol.sdk.openapi.okhttp_gson.model.MosaicNamesDTO in project nem2-sdk-java by nemtech.
the class NamespaceRepositoryOkHttpImplTest method shouldGetMosaicsNamesFromPublicKeys.
@Test
public void shouldGetMosaicsNamesFromPublicKeys() throws Exception {
MosaicId mosaicId = MapperUtils.toMosaicId("99262122238339734");
MosaicNamesDTO dto = new MosaicNamesDTO();
dto.setMosaicId("99262122238339734");
dto.setNames(Collections.singletonList("accountalias"));
MosaicsNamesDTO accountsNamesDTO = new MosaicsNamesDTO();
accountsNamesDTO.setMosaicNames(Collections.singletonList(dto));
mockRemoteCall(accountsNamesDTO);
List<MosaicNames> resolvedList = repository.getMosaicsNames(Collections.singletonList(mosaicId)).toFuture().get();
Assertions.assertEquals(1, resolvedList.size());
MosaicNames accountNames = resolvedList.get(0);
Assertions.assertEquals(mosaicId, accountNames.getMosaicId());
Assertions.assertEquals("accountalias", accountNames.getNames().get(0).getName());
}
Aggregations