Blame view

src/test/java/pl/labno/bernard/nbp/exchangerate/UpdaterTest.java 937 Bytes
bernard authored
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
package pl.labno.bernard.nbp.exchangerate;

import org.junit.Assert;
import org.junit.Test;
import pl.labno.bernard.nbp.exchangerate.rest.generated.ExchangeRate;
import pl.labno.bernard.nbp.exchangerate.rest.generated.ExchangeRateTable;
import yarfraw.core.datamodel.YarfrawException;

import javax.xml.bind.JAXBException;
import java.io.IOException;

public class UpdaterTest {

    @Test
    public void testGetRecentExchangeTable() throws YarfrawException, IOException, JAXBException {
        final ExchangeRateTable recentExchangeTable = new Updater().getRecentExchangeTable();
        Assert.assertNotNull(recentExchangeTable);
        for (ExchangeRate exchangeRate : recentExchangeTable.getItems()) {
            Assert.assertNotNull(exchangeRate.getCurrencyName());
            Assert.assertNotNull(exchangeRate.getCurrencySymbol());
            Assert.assertTrue(exchangeRate.getValue().doubleValue() != 0d);
        }
    }
}