Search in sources :

Example 6 with AccountInfoDTO

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

the class AccountRepositoryVertxImplTest method shouldProcessExceptionWhenNotFoundInvalidResponse.

@Test
public void shouldProcessExceptionWhenNotFoundInvalidResponse() {
    Address address = Address.generateRandom(this.networkType);
    AccountDTO accountDTO = new AccountDTO();
    accountDTO.setAccountType(AccountTypeEnum.NUMBER_1);
    accountDTO.setAddress(encodeAddress(address));
    AccountInfoDTO accountInfoDTO = new AccountInfoDTO();
    accountInfoDTO.setAccount(accountDTO);
    mockErrorCodeRawResponse(400, "I'm a raw error, not json");
    Assertions.assertEquals("ApiException: Bad Request - 400 - I'm a raw error, not json", Assertions.assertThrows(RepositoryCallException.class, () -> {
        ExceptionUtils.propagate(() -> repository.getAccountInfo(address).toFuture().get());
    }).getMessage());
}
Also used : AccountInfoDTO(io.nem.symbol.sdk.openapi.vertx.model.AccountInfoDTO) Address(io.nem.symbol.sdk.model.account.Address) AccountDTO(io.nem.symbol.sdk.openapi.vertx.model.AccountDTO) Test(org.junit.jupiter.api.Test)

Aggregations

Address (io.nem.symbol.sdk.model.account.Address)6 AccountDTO (io.nem.symbol.sdk.openapi.vertx.model.AccountDTO)6 AccountInfoDTO (io.nem.symbol.sdk.openapi.vertx.model.AccountInfoDTO)6 Test (org.junit.jupiter.api.Test)5 AccountInfo (io.nem.symbol.sdk.model.account.AccountInfo)4 Account (io.nem.symbol.sdk.model.account.Account)3 AccountLinkPublicKeyDTO (io.nem.symbol.sdk.openapi.vertx.model.AccountLinkPublicKeyDTO)3 SupplementalPublicKeysDTO (io.nem.symbol.sdk.openapi.vertx.model.SupplementalPublicKeysDTO)3 AccountSearchCriteria (io.nem.symbol.sdk.api.AccountSearchCriteria)2 ActivityBucketDTO (io.nem.symbol.sdk.openapi.vertx.model.ActivityBucketDTO)2 BigInteger (java.math.BigInteger)2 PublicKey (io.nem.symbol.core.crypto.PublicKey)1 MapperUtils.toAddress (io.nem.symbol.core.utils.MapperUtils.toAddress)1 MapperUtils.toMosaicId (io.nem.symbol.core.utils.MapperUtils.toMosaicId)1 AccountRepository (io.nem.symbol.sdk.api.AccountRepository)1 Page (io.nem.symbol.sdk.api.Page)1 AccountLinkVotingKey (io.nem.symbol.sdk.model.account.AccountLinkVotingKey)1 AccountType (io.nem.symbol.sdk.model.account.AccountType)1 ActivityBucket (io.nem.symbol.sdk.model.account.ActivityBucket)1 SupplementalAccountKeys (io.nem.symbol.sdk.model.account.SupplementalAccountKeys)1