Search in sources :

Example 1 with KrakenCancelOrderResult

use of org.knowm.xchange.kraken.dto.trade.results.KrakenCancelOrderResult in project XChange by knowm.

the class KrakenTradeJsonTest method testCancelOrderUnmarshal.

@Test
public void testCancelOrderUnmarshal() throws IOException {
    // Read in the JSON from the example resources
    InputStream is = KrakenTradeJsonTest.class.getResourceAsStream("/org/knowm/xchange/kraken/dto/trading/example-cancelorder-data.json");
    // Use Jackson to parse it
    ObjectMapper mapper = new ObjectMapper();
    KrakenCancelOrderResult krakenResult = mapper.readValue(is, KrakenCancelOrderResult.class);
    KrakenCancelOrderResponse cancelOrderResponse = krakenResult.getResult();
    assertThat(cancelOrderResponse.getCount()).isEqualTo(1);
    assertFalse(cancelOrderResponse.isPending());
}
Also used : KrakenCancelOrderResult(org.knowm.xchange.kraken.dto.trade.results.KrakenCancelOrderResult) InputStream(java.io.InputStream) KrakenCancelOrderResponse(org.knowm.xchange.kraken.dto.trade.results.KrakenCancelOrderResult.KrakenCancelOrderResponse) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Test(org.junit.Test)

Aggregations

ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 InputStream (java.io.InputStream)1 Test (org.junit.Test)1 KrakenCancelOrderResult (org.knowm.xchange.kraken.dto.trade.results.KrakenCancelOrderResult)1 KrakenCancelOrderResponse (org.knowm.xchange.kraken.dto.trade.results.KrakenCancelOrderResult.KrakenCancelOrderResponse)1