### Question:
AccountRepositoryOkHttpImpl extends AbstractRepositoryOkHttpImpl implements AccountRepository { @Override public Observable<AccountInfo> getAccountInfo(Address address) { Callable<AccountInfoDTO> callback = () -> getClient().getAccountInfo(address.plain()); return exceptionHandling(call(callback).map(this::toAccountInfo)); } AccountRepositoryOkHttpImpl(ApiClient apiClient); @Override Observable<AccountInfo> getAccountInfo(Address address); @Override Observable<List<AccountInfo>> getAccountsInfo(List<Address> addresses); @Override Observable<Page<AccountInfo>> search(AccountSearchCriteria criteria);  }### Answer:
@Test public void shouldProcessExceptionWhenNotFound() throws Exception { Address address = Address.generateRandom(networkType); AccountDTO accountDTO = new AccountDTO(); accountDTO.setAccountType(AccountTypeEnum.NUMBER_1); accountDTO.setAddress(encodeAddress(address)); AccountInfoDTO accountInfoDTO = new AccountInfoDTO(); accountInfoDTO.setAccount(accountDTO); mockErrorCode(404, "Account not found!"); Assertions.assertEquals( "ApiException: Not Found - 404 - Code Not Found - Account not found!", Assertions.assertThrows( RepositoryCallException.class, () -> { ExceptionUtils.propagate( () -> repository.getAccountInfo(address).toFuture().get()); }) .getMessage()); }
@Test public void shouldProcessExceptionWhenNotFoundInvalidResponse() throws Exception { Address address = Address.generateRandom(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()); }