1 package org.oxerr.okcoin.rest.dto; 2 3 import static org.junit.Assert.assertEquals; 4 5 import java.io.IOException; 6 import java.math.BigDecimal; 7 import java.time.Instant; 8 9 import org.junit.Test; 10 11 import com.fasterxml.jackson.core.JsonParseException; 12 import com.fasterxml.jackson.databind.JsonMappingException; 13 14 public class TickerTest extends UnmarshalTest { 15 16 @Test 17 public void test() throws JsonParseException, JsonMappingException, 18 IOException { 19 TickerResponse tickerResponse = readValue("ticker.json", 20 TickerResponse.class); 21 assertEquals(Instant.ofEpochSecond(1410431279L), 22 tickerResponse.getDate()); 23 Ticker ticker = tickerResponse.getTicker(); 24 assertEquals(new BigDecimal("34.15"), ticker.getHigh()); 25 assertEquals(new BigDecimal("32.05"), ticker.getLow()); 26 assertEquals(new BigDecimal("33.15"), ticker.getBuy()); 27 assertEquals(new BigDecimal("33.16"), ticker.getSell()); 28 assertEquals(new BigDecimal("33.15"), ticker.getLast()); 29 assertEquals(new BigDecimal("10532696.39199642"), ticker.getVol()); 30 } 31 32 }