@Test public void getBalance() throws IOException, VscaleException { Result<Balance> query = this.api.balance(); Balance balance = query.get(); assertNotNull(balance); assertNotNull(balance.getBalance()); assertNotNull(balance.getBonus()); assertNotNull(balance.getStatus()); assertNotNull(balance.getSumm()); assertNotNull(balance.getUnpaid()); assertNotNull(balance.getUserId()); }
@Test public void getAccountTest() throws IOException, VscaleException { Result<Account> query = this.api.account(); Account account = query.get(); assertNotNull(account.getActivationDate()); assertNotNull(account.getCountry()); assertNotNull(account.getId()); assertNotNull(account.getEmail()); assertNotNull(account.getFaceId()); assertNotNull(account.getState()); assertNotNull(account.getLocale()); assertNotNull(account.getMobile()); assertNotNull(account.getName()); assertNotNull(account.getSurname()); }
@Test public void getPayments() throws IOException, VscaleException { Result<Payments> query = this.api.payments(); Payments payments = query.get(); assertNotNull(payments); assertNotNull(payments.getItems()); assertNotNull(payments.getStatus()); assertTrue(payments.getItems().size() > 0); Payment payment = payments.getItems().get(0); assertNotNull(payment.getCreated()); assertNotNull(payment.getDescription()); assertNotNull(payment.getId()); assertNotNull(payment.isBonus()); assertNotNull(payment.getPrice()); assertNotNull(payment.getState()); assertNotNull(payment.getType()); }
@Test public void getConsumptions() throws IOException, VscaleException { Result<ConsumptionList> query = this.api.consumptions(new Date(1443657600000L), new Date(1448928000000L)); ConsumptionList consumptionList = query.get(); assertNotNull(consumptionList); assertNotNull(consumptionList.getConsumptions()); assertTrue(consumptionList.getConsumptions().size() > 0); Map<Long, Consumption> consumptions = consumptionList.getConsumptions(); for (Map.Entry<Long, Consumption> entry : consumptions.entrySet()) { assertNotNull(entry.getKey()); assertNotNull(entry.getValue()); Consumption consumption = entry.getValue(); assertNotNull(consumption.getTotal()); assertNotNull(consumption.getItems()); assertTrue(consumption.getItems().size() > 0); Map<String, ConsumptionItem> items = consumption.getItems(); for (Map.Entry<String, ConsumptionItem> itemEntry : items.entrySet()) { assertNotNull(itemEntry.getKey()); assertNotNull(itemEntry.getValue()); ConsumptionItem consumptionItem = itemEntry.getValue(); assertNotNull(consumptionItem.getCount()); assertNotNull(consumptionItem.getSum()); } } }