src_fm_fc_ms_ff
stringlengths
43
86.8k
target
stringlengths
20
276k
JsonUtils { @SuppressWarnings("unchecked") public static Map<String, String> jsonToMap(Reader in) { AwsJsonReader reader = getJsonReader(in); try { if (reader.peek() == null) { return Collections.EMPTY_MAP; } Map<String, String> map = new HashMap<String, String>(); reader.beginObject(); while (reader.hasNext()) { Strin...
@Test public void testJsonToMap() { Map<String, String> map = JsonUtils.jsonToMap(JSON_STRING); assertEquals("string value", "string", map.get("string")); assertEquals("long value", "123", map.get("long")); assertEquals("double value", "123.45", map.get("double")); assertEquals("null value", null, map.get("null")); ass...
JsonUtils { public static String mapToString(Map<String, String> map) { if (map == null || map.isEmpty()) { return "{}"; } try { StringWriter out = new StringWriter(); AwsJsonWriter writer = getJsonWriter(out); writer.beginObject(); for (Map.Entry<String, String> entry : map.entrySet()) { writer.name(entry.getKey()).va...
@Test public void testEmptyMapToJson() { Map<String, String> source = new HashMap<String, String>(); assertEquals("empty map", "{}", JsonUtils.mapToString(source)); }
JsonUtils { public static AwsJsonReader getJsonReader(Reader in) { if (factory == null) { throw new IllegalStateException("Json engine is unavailable."); } return factory.getJsonReader(in); } static void setJsonEngine(JsonEngine jsonEngine); static AwsJsonReader getJsonReader(Reader in); static AwsJsonWriter getJsonWr...
@Test public void testJsonReader() throws IOException { AwsJsonReader reader = JsonUtils.getJsonReader(new StringReader(JSON_STRING)); reader.beginObject(); assertTrue("has properties", reader.hasNext()); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("string")) { assertTrue("VALUE_STRING",...
JsonUtils { public static AwsJsonWriter getJsonWriter(Writer out) { if (factory == null) { throw new IllegalStateException("Json engine is unavailable."); } return factory.getJsonWriter(out); } static void setJsonEngine(JsonEngine jsonEngine); static AwsJsonReader getJsonReader(Reader in); static AwsJsonWriter getJson...
@Test public void testJsonWriter() throws IOException { StringWriter out = new StringWriter(); AwsJsonWriter writer = JsonUtils.getJsonWriter(out); writer.beginObject() .name("string").value("string") .name("long").value(123) .name("double").value(123.45) .name("null").value() .name("true").value(true) .name("false").v...
PeriodicRateGenerator implements RateGenerator { @Override public double getRate(long time) { double valueInPeriod = normalizeValue(time); double result = rateFunction(valueInPeriod); LOGGER.trace("rateFunction returned: {} for value: {}", result, valueInPeriod); return result < 0 ? 0d : result; } PeriodicRateGenerator...
@Test public void rate_should_return_1_when_period_is_100_and_time_is_201() { ConcretePeriodicRateGenerator periodicRateGenerator = new ConcretePeriodicRateGenerator(100); double rate = periodicRateGenerator.getRate(TimeUnit.SECONDS.toNanos(201)); Assert.assertEquals(1d, rate, DELTA); } @Test public void rate_should_re...
LoadGenerator { public void run() { try { checkState(); LOGGER.info("Load generator started."); long beginning = System.nanoTime(); long previous = beginning; infiniteWhile: while (true) { if (terminate.get()) { LOGGER.info("Termination signal detected. Terminating load generator..."); break; } long now = System.nanoTi...
@Test(timeout = DEFAULT_TEST_TIMEOUT) public void loadGenerator_should_be_terminated_when_dataSource_has_no_next_element() { LoadGenerator<Integer> loadGenerator = new LoadGenerator<>(new DataSource<Integer>() { @Override public boolean hasNext(long time) { return false; } @Override public Integer getNext(long time) { ...
LinkedEvictingBlockingQueue { public T take() throws InterruptedException { final ReentrantLock lock = this.lock; lock.lock(); try { T x; while ((x = unlinkFromHead()) == null) notEmpty.await(); return x; } finally { lock.unlock(); } } LinkedEvictingBlockingQueue(); LinkedEvictingBlockingQueue(boolean dropFromHead); ...
@Test(timeout = 2000) public void should_not_take_value_from_queue_when_value_is_not_put() throws InterruptedException { LinkedEvictingBlockingQueue<Integer> queue = new LinkedEvictingBlockingQueue<>(); Thread takeFromQueueThread = newStartedThread(() -> { try { queue.take(); } catch (InterruptedException e) { } }); Th...
InternalWorker implements Consumer<T>, AutoCloseable { @Override public void close() throws Exception { if (!closed) { threadPoolExecutor.shutdownNow(); closed = true; } } InternalWorker(Worker<T> delegate, int queueCapacity); InternalWorker(Worker<T> delegate, int queueCapacity, boolean dropFromHead); InternalWorker...
@Test(timeout = 3000) public void should_not_block_thread_when_delegate_of_asyncWorker_is_blocking() throws Exception { RateGenerator rg = new ConstantRateGenerator(10); Object lock = new Object(); AtomicInteger delegateInvokeCount = new AtomicInteger(); Worker<Integer> delegate = (x, y, z) -> { synchronized (lock) { d...
Balance { public Balance exchangeId(String exchangeId) { this.exchangeId = exchangeId; return this; } Balance exchangeId(String exchangeId); @javax.annotation.Nullable @ApiModelProperty(example = "KRAKEN", value = "Exchange identifier used to identify the routing destination.") String getExchangeId(); void setExchange...
@Test public void exchangeIdTest() { }
ValidationError { public ValidationError errors(String errors) { this.errors = errors; return this; } ValidationError type(String type); @javax.annotation.Nullable @ApiModelProperty(example = "https://tools.ietf.org/html/rfc7231#section-6.5.1", value = "") String getType(); void setType(String type); ValidationError t...
@Test public void errorsTest() { }
OrderExecutionReportAllOf { public OrderExecutionReportAllOf clientOrderIdFormatExchange(String clientOrderIdFormatExchange) { this.clientOrderIdFormatExchange = clientOrderIdFormatExchange; return this; } OrderExecutionReportAllOf clientOrderIdFormatExchange(String clientOrderIdFormatExchange); @ApiModelProperty(exam...
@Test public void clientOrderIdFormatExchangeTest() { }
OrderExecutionReportAllOf { public OrderExecutionReportAllOf exchangeOrderId(String exchangeOrderId) { this.exchangeOrderId = exchangeOrderId; return this; } OrderExecutionReportAllOf clientOrderIdFormatExchange(String clientOrderIdFormatExchange); @ApiModelProperty(example = "f81211e2-27c4-b86a-8143-01088ba9222c", re...
@Test public void exchangeOrderIdTest() { }
OrderExecutionReportAllOf { public OrderExecutionReportAllOf amountOpen(BigDecimal amountOpen) { this.amountOpen = amountOpen; return this; } OrderExecutionReportAllOf clientOrderIdFormatExchange(String clientOrderIdFormatExchange); @ApiModelProperty(example = "f81211e2-27c4-b86a-8143-01088ba9222c", required = true, v...
@Test public void amountOpenTest() { }
OrderExecutionReportAllOf { public OrderExecutionReportAllOf amountFilled(BigDecimal amountFilled) { this.amountFilled = amountFilled; return this; } OrderExecutionReportAllOf clientOrderIdFormatExchange(String clientOrderIdFormatExchange); @ApiModelProperty(example = "f81211e2-27c4-b86a-8143-01088ba9222c", required =...
@Test public void amountFilledTest() { }
OrderExecutionReportAllOf { public OrderExecutionReportAllOf avgPx(BigDecimal avgPx) { this.avgPx = avgPx; return this; } OrderExecutionReportAllOf clientOrderIdFormatExchange(String clientOrderIdFormatExchange); @ApiModelProperty(example = "f81211e2-27c4-b86a-8143-01088ba9222c", required = true, value = "The unique i...
@Test public void avgPxTest() { }
OrderExecutionReportAllOf { public OrderExecutionReportAllOf status(OrdStatus status) { this.status = status; return this; } OrderExecutionReportAllOf clientOrderIdFormatExchange(String clientOrderIdFormatExchange); @ApiModelProperty(example = "f81211e2-27c4-b86a-8143-01088ba9222c", required = true, value = "The uniqu...
@Test public void statusTest() { }
OrderExecutionReportAllOf { public OrderExecutionReportAllOf statusHistory(List<List<String>> statusHistory) { this.statusHistory = statusHistory; return this; } OrderExecutionReportAllOf clientOrderIdFormatExchange(String clientOrderIdFormatExchange); @ApiModelProperty(example = "f81211e2-27c4-b86a-8143-01088ba9222c"...
@Test public void statusHistoryTest() { }
OrderExecutionReportAllOf { public OrderExecutionReportAllOf errorMessage(String errorMessage) { this.errorMessage = errorMessage; return this; } OrderExecutionReportAllOf clientOrderIdFormatExchange(String clientOrderIdFormatExchange); @ApiModelProperty(example = "f81211e2-27c4-b86a-8143-01088ba9222c", required = tru...
@Test public void errorMessageTest() { }
OrderExecutionReportAllOf { public OrderExecutionReportAllOf fills(List<Fills> fills) { this.fills = fills; return this; } OrderExecutionReportAllOf clientOrderIdFormatExchange(String clientOrderIdFormatExchange); @ApiModelProperty(example = "f81211e2-27c4-b86a-8143-01088ba9222c", required = true, value = "The unique ...
@Test public void fillsTest() { }
Balance { public Balance data(List<BalanceData> data) { this.data = data; return this; } Balance exchangeId(String exchangeId); @javax.annotation.Nullable @ApiModelProperty(example = "KRAKEN", value = "Exchange identifier used to identify the routing destination.") String getExchangeId(); void setExchangeId(String exc...
@Test public void dataTest() { }
OrderNewSingleRequest { public OrderNewSingleRequest exchangeId(String exchangeId) { this.exchangeId = exchangeId; return this; } OrderNewSingleRequest exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Exchange identifier used to identify the routing destination.") String g...
@Test public void exchangeIdTest() { }
OrderNewSingleRequest { public OrderNewSingleRequest clientOrderId(String clientOrderId) { this.clientOrderId = clientOrderId; return this; } OrderNewSingleRequest exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Exchange identifier used to identify the routing destination...
@Test public void clientOrderIdTest() { }
OrderNewSingleRequest { public OrderNewSingleRequest symbolIdExchange(String symbolIdExchange) { this.symbolIdExchange = symbolIdExchange; return this; } OrderNewSingleRequest exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Exchange identifier used to identify the routing...
@Test public void symbolIdExchangeTest() { }
OrderNewSingleRequest { public OrderNewSingleRequest symbolIdCoinapi(String symbolIdCoinapi) { this.symbolIdCoinapi = symbolIdCoinapi; return this; } OrderNewSingleRequest exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Exchange identifier used to identify the routing des...
@Test public void symbolIdCoinapiTest() { }
OrderNewSingleRequest { public OrderNewSingleRequest amountOrder(BigDecimal amountOrder) { this.amountOrder = amountOrder; return this; } OrderNewSingleRequest exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Exchange identifier used to identify the routing destination.") ...
@Test public void amountOrderTest() { }
OrderNewSingleRequest { public OrderNewSingleRequest price(BigDecimal price) { this.price = price; return this; } OrderNewSingleRequest exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Exchange identifier used to identify the routing destination.") String getExchangeId(); ...
@Test public void priceTest() { }
OrderNewSingleRequest { public OrderNewSingleRequest side(OrdSide side) { this.side = side; return this; } OrderNewSingleRequest exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Exchange identifier used to identify the routing destination.") String getExchangeId(); void se...
@Test public void sideTest() { }
OrderNewSingleRequest { public OrderNewSingleRequest orderType(OrdType orderType) { this.orderType = orderType; return this; } OrderNewSingleRequest exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Exchange identifier used to identify the routing destination.") String getE...
@Test public void orderTypeTest() { }
OrderNewSingleRequest { public OrderNewSingleRequest timeInForce(TimeInForce timeInForce) { this.timeInForce = timeInForce; return this; } OrderNewSingleRequest exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Exchange identifier used to identify the routing destination.")...
@Test public void timeInForceTest() { }
OrderNewSingleRequest { public OrderNewSingleRequest expireTime(LocalDate expireTime) { this.expireTime = expireTime; return this; } OrderNewSingleRequest exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Exchange identifier used to identify the routing destination.") Strin...
@Test public void expireTimeTest() { }
OrderCancelAllRequest { public OrderCancelAllRequest exchangeId(String exchangeId) { this.exchangeId = exchangeId; return this; } OrderCancelAllRequest exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Identifier of the exchange from which active orders should be canceled."...
@Test public void exchangeIdTest() { }
OrderNewSingleRequest { public OrderNewSingleRequest execInst(List<ExecInstEnum> execInst) { this.execInst = execInst; return this; } OrderNewSingleRequest exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Exchange identifier used to identify the routing destination.") Stri...
@Test public void execInstTest() { }
Fills { public Fills time(LocalDate time) { this.time = time; return this; } Fills time(LocalDate time); @javax.annotation.Nullable @ApiModelProperty(example = "2020-01-01T10:45:20.1677709Z", value = "Execution time.") LocalDate getTime(); void setTime(LocalDate time); Fills price(BigDecimal price); @javax.annotation....
@Test public void timeTest() { }
Fills { public Fills price(BigDecimal price) { this.price = price; return this; } Fills time(LocalDate time); @javax.annotation.Nullable @ApiModelProperty(example = "2020-01-01T10:45:20.1677709Z", value = "Execution time.") LocalDate getTime(); void setTime(LocalDate time); Fills price(BigDecimal price); @javax.annota...
@Test public void priceTest() { }
Fills { public Fills amount(BigDecimal amount) { this.amount = amount; return this; } Fills time(LocalDate time); @javax.annotation.Nullable @ApiModelProperty(example = "2020-01-01T10:45:20.1677709Z", value = "Execution time.") LocalDate getTime(); void setTime(LocalDate time); Fills price(BigDecimal price); @javax.an...
@Test public void amountTest() { }
OrderExecutionReport { public OrderExecutionReport exchangeId(String exchangeId) { this.exchangeId = exchangeId; return this; } OrderExecutionReport exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Exchange identifier used to identify the routing destination.") String getE...
@Test public void exchangeIdTest() { }
OrderExecutionReport { public OrderExecutionReport clientOrderId(String clientOrderId) { this.clientOrderId = clientOrderId; return this; } OrderExecutionReport exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Exchange identifier used to identify the routing destination.")...
@Test public void clientOrderIdTest() { }
OrderExecutionReport { public OrderExecutionReport symbolIdExchange(String symbolIdExchange) { this.symbolIdExchange = symbolIdExchange; return this; } OrderExecutionReport exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Exchange identifier used to identify the routing de...
@Test public void symbolIdExchangeTest() { }
OrderExecutionReport { public OrderExecutionReport symbolIdCoinapi(String symbolIdCoinapi) { this.symbolIdCoinapi = symbolIdCoinapi; return this; } OrderExecutionReport exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Exchange identifier used to identify the routing destin...
@Test public void symbolIdCoinapiTest() { }
OrderExecutionReport { public OrderExecutionReport amountOrder(BigDecimal amountOrder) { this.amountOrder = amountOrder; return this; } OrderExecutionReport exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Exchange identifier used to identify the routing destination.") Str...
@Test public void amountOrderTest() { }
OrderExecutionReport { public OrderExecutionReport price(BigDecimal price) { this.price = price; return this; } OrderExecutionReport exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Exchange identifier used to identify the routing destination.") String getExchangeId(); voi...
@Test public void priceTest() { }
OrderCancelSingleRequest { public OrderCancelSingleRequest exchangeId(String exchangeId) { this.exchangeId = exchangeId; return this; } OrderCancelSingleRequest exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Exchange identifier used to identify the routing destination.")...
@Test public void exchangeIdTest() { }
OrderExecutionReport { public OrderExecutionReport side(OrdSide side) { this.side = side; return this; } OrderExecutionReport exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Exchange identifier used to identify the routing destination.") String getExchangeId(); void setEx...
@Test public void sideTest() { }
OrderExecutionReport { public OrderExecutionReport orderType(OrdType orderType) { this.orderType = orderType; return this; } OrderExecutionReport exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Exchange identifier used to identify the routing destination.") String getExch...
@Test public void orderTypeTest() { }
OrderExecutionReport { public OrderExecutionReport timeInForce(TimeInForce timeInForce) { this.timeInForce = timeInForce; return this; } OrderExecutionReport exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Exchange identifier used to identify the routing destination.") St...
@Test public void timeInForceTest() { }
OrderExecutionReport { public OrderExecutionReport expireTime(LocalDate expireTime) { this.expireTime = expireTime; return this; } OrderExecutionReport exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Exchange identifier used to identify the routing destination.") String g...
@Test public void expireTimeTest() { }
OrderExecutionReport { public OrderExecutionReport execInst(List<ExecInstEnum> execInst) { this.execInst = execInst; return this; } OrderExecutionReport exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Exchange identifier used to identify the routing destination.") String ...
@Test public void execInstTest() { }
OrderExecutionReport { public OrderExecutionReport clientOrderIdFormatExchange(String clientOrderIdFormatExchange) { this.clientOrderIdFormatExchange = clientOrderIdFormatExchange; return this; } OrderExecutionReport exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Exchang...
@Test public void clientOrderIdFormatExchangeTest() { }
OrderExecutionReport { public OrderExecutionReport exchangeOrderId(String exchangeOrderId) { this.exchangeOrderId = exchangeOrderId; return this; } OrderExecutionReport exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Exchange identifier used to identify the routing destin...
@Test public void exchangeOrderIdTest() { }
OrderExecutionReport { public OrderExecutionReport amountOpen(BigDecimal amountOpen) { this.amountOpen = amountOpen; return this; } OrderExecutionReport exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Exchange identifier used to identify the routing destination.") String ...
@Test public void amountOpenTest() { }
OrderExecutionReport { public OrderExecutionReport amountFilled(BigDecimal amountFilled) { this.amountFilled = amountFilled; return this; } OrderExecutionReport exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Exchange identifier used to identify the routing destination.")...
@Test public void amountFilledTest() { }
OrderExecutionReport { public OrderExecutionReport avgPx(BigDecimal avgPx) { this.avgPx = avgPx; return this; } OrderExecutionReport exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Exchange identifier used to identify the routing destination.") String getExchangeId(); voi...
@Test public void avgPxTest() { }
OrderCancelSingleRequest { public OrderCancelSingleRequest exchangeOrderId(String exchangeOrderId) { this.exchangeOrderId = exchangeOrderId; return this; } OrderCancelSingleRequest exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Exchange identifier used to identify the ro...
@Test public void exchangeOrderIdTest() { }
OrderExecutionReport { public OrderExecutionReport status(OrdStatus status) { this.status = status; return this; } OrderExecutionReport exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Exchange identifier used to identify the routing destination.") String getExchangeId(); ...
@Test public void statusTest() { }
OrderExecutionReport { public OrderExecutionReport statusHistory(List<List<String>> statusHistory) { this.statusHistory = statusHistory; return this; } OrderExecutionReport exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Exchange identifier used to identify the routing de...
@Test public void statusHistoryTest() { }
OrderExecutionReport { public OrderExecutionReport errorMessage(String errorMessage) { this.errorMessage = errorMessage; return this; } OrderExecutionReport exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Exchange identifier used to identify the routing destination.") Str...
@Test public void errorMessageTest() { }
OrderExecutionReport { public OrderExecutionReport fills(List<Fills> fills) { this.fills = fills; return this; } OrderExecutionReport exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Exchange identifier used to identify the routing destination.") String getExchangeId(); vo...
@Test public void fillsTest() { }
BalanceData { public BalanceData assetIdExchange(String assetIdExchange) { this.assetIdExchange = assetIdExchange; return this; } BalanceData assetIdExchange(String assetIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBT", value = "Exchange currency code.") String getAssetIdExchange(); void setAs...
@Test public void assetIdExchangeTest() { }
BalanceData { public BalanceData assetIdCoinapi(String assetIdCoinapi) { this.assetIdCoinapi = assetIdCoinapi; return this; } BalanceData assetIdExchange(String assetIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBT", value = "Exchange currency code.") String getAssetIdExchange(); void setAssetI...
@Test public void assetIdCoinapiTest() { }
BalanceData { public BalanceData balance(Float balance) { this.balance = balance; return this; } BalanceData assetIdExchange(String assetIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBT", value = "Exchange currency code.") String getAssetIdExchange(); void setAssetIdExchange(String assetIdExcha...
@Test public void balanceTest() { }
BalanceData { public BalanceData available(Float available) { this.available = available; return this; } BalanceData assetIdExchange(String assetIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBT", value = "Exchange currency code.") String getAssetIdExchange(); void setAssetIdExchange(String asse...
@Test public void availableTest() { }
BalanceData { public BalanceData locked(Float locked) { this.locked = locked; return this; } BalanceData assetIdExchange(String assetIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBT", value = "Exchange currency code.") String getAssetIdExchange(); void setAssetIdExchange(String assetIdExchange)...
@Test public void lockedTest() { }
BalanceData { public BalanceData lastUpdatedBy(LastUpdatedByEnum lastUpdatedBy) { this.lastUpdatedBy = lastUpdatedBy; return this; } BalanceData assetIdExchange(String assetIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBT", value = "Exchange currency code.") String getAssetIdExchange(); void se...
@Test public void lastUpdatedByTest() { }
OrderCancelSingleRequest { public OrderCancelSingleRequest clientOrderId(String clientOrderId) { this.clientOrderId = clientOrderId; return this; } OrderCancelSingleRequest exchangeId(String exchangeId); @ApiModelProperty(example = "KRAKEN", required = true, value = "Exchange identifier used to identify the routing de...
@Test public void clientOrderIdTest() { }
BalanceData { public BalanceData rateUsd(Float rateUsd) { this.rateUsd = rateUsd; return this; } BalanceData assetIdExchange(String assetIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBT", value = "Exchange currency code.") String getAssetIdExchange(); void setAssetIdExchange(String assetIdExcha...
@Test public void rateUsdTest() { }
BalanceData { public BalanceData traded(Float traded) { this.traded = traded; return this; } BalanceData assetIdExchange(String assetIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBT", value = "Exchange currency code.") String getAssetIdExchange(); void setAssetIdExchange(String assetIdExchange)...
@Test public void tradedTest() { }
Message { public Message message(String message) { this.message = message; return this; } Message type(String type); @javax.annotation.Nullable @ApiModelProperty(example = "message", value = "Type of message.") String getType(); void setType(String type); Message severity(Severity severity); @javax.annotation.Nullable...
@Test public void testMessage() { } @Test public void messageTest() { }
Message { public Message type(String type) { this.type = type; return this; } Message type(String type); @javax.annotation.Nullable @ApiModelProperty(example = "message", value = "Type of message.") String getType(); void setType(String type); Message severity(Severity severity); @javax.annotation.Nullable @ApiModelPr...
@Test public void typeTest() { }
Message { public Message severity(Severity severity) { this.severity = severity; return this; } Message type(String type); @javax.annotation.Nullable @ApiModelProperty(example = "message", value = "Type of message.") String getType(); void setType(String type); Message severity(Severity severity); @javax.annotation.Nu...
@Test public void severityTest() { }
Message { public Message exchangeId(String exchangeId) { this.exchangeId = exchangeId; return this; } Message type(String type); @javax.annotation.Nullable @ApiModelProperty(example = "message", value = "Type of message.") String getType(); void setType(String type); Message severity(Severity severity); @javax.annotat...
@Test public void exchangeIdTest() { }
PositionData { public PositionData symbolIdExchange(String symbolIdExchange) { this.symbolIdExchange = symbolIdExchange; return this; } PositionData symbolIdExchange(String symbolIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBTUSD", value = "Exchange symbol.") String getSymbolIdExchange(); void...
@Test public void symbolIdExchangeTest() { }
PositionData { public PositionData symbolIdCoinapi(String symbolIdCoinapi) { this.symbolIdCoinapi = symbolIdCoinapi; return this; } PositionData symbolIdExchange(String symbolIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBTUSD", value = "Exchange symbol.") String getSymbolIdExchange(); void set...
@Test public void symbolIdCoinapiTest() { }
PositionData { public PositionData avgEntryPrice(BigDecimal avgEntryPrice) { this.avgEntryPrice = avgEntryPrice; return this; } PositionData symbolIdExchange(String symbolIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBTUSD", value = "Exchange symbol.") String getSymbolIdExchange(); void setSymb...
@Test public void avgEntryPriceTest() { }
ValidationError { public ValidationError type(String type) { this.type = type; return this; } ValidationError type(String type); @javax.annotation.Nullable @ApiModelProperty(example = "https://tools.ietf.org/html/rfc7231#section-6.5.1", value = "") String getType(); void setType(String type); ValidationError title(Str...
@Test public void typeTest() { }
PositionData { public PositionData quantity(BigDecimal quantity) { this.quantity = quantity; return this; } PositionData symbolIdExchange(String symbolIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBTUSD", value = "Exchange symbol.") String getSymbolIdExchange(); void setSymbolIdExchange(String ...
@Test public void quantityTest() { }
PositionData { public PositionData side(OrdSide side) { this.side = side; return this; } PositionData symbolIdExchange(String symbolIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBTUSD", value = "Exchange symbol.") String getSymbolIdExchange(); void setSymbolIdExchange(String symbolIdExchange); ...
@Test public void sideTest() { }
PositionData { public PositionData unrealizedPnl(BigDecimal unrealizedPnl) { this.unrealizedPnl = unrealizedPnl; return this; } PositionData symbolIdExchange(String symbolIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBTUSD", value = "Exchange symbol.") String getSymbolIdExchange(); void setSymb...
@Test public void unrealizedPnlTest() { }
PositionData { public PositionData leverage(BigDecimal leverage) { this.leverage = leverage; return this; } PositionData symbolIdExchange(String symbolIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBTUSD", value = "Exchange symbol.") String getSymbolIdExchange(); void setSymbolIdExchange(String ...
@Test public void leverageTest() { }
PositionData { public PositionData crossMargin(Boolean crossMargin) { this.crossMargin = crossMargin; return this; } PositionData symbolIdExchange(String symbolIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBTUSD", value = "Exchange symbol.") String getSymbolIdExchange(); void setSymbolIdExchang...
@Test public void crossMarginTest() { }
PositionData { public PositionData liquidationPrice(BigDecimal liquidationPrice) { this.liquidationPrice = liquidationPrice; return this; } PositionData symbolIdExchange(String symbolIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBTUSD", value = "Exchange symbol.") String getSymbolIdExchange(); ...
@Test public void liquidationPriceTest() { }
PositionData { public PositionData rawData(Object rawData) { this.rawData = rawData; return this; } PositionData symbolIdExchange(String symbolIdExchange); @javax.annotation.Nullable @ApiModelProperty(example = "XBTUSD", value = "Exchange symbol.") String getSymbolIdExchange(); void setSymbolIdExchange(String symbolId...
@Test public void rawDataTest() { }
Position { public Position exchangeId(String exchangeId) { this.exchangeId = exchangeId; return this; } Position exchangeId(String exchangeId); @javax.annotation.Nullable @ApiModelProperty(example = "KRAKEN", value = "Exchange identifier used to identify the routing destination.") String getExchangeId(); void setExcha...
@Test public void exchangeIdTest() { }
Position { public Position data(List<PositionData> data) { this.data = data; return this; } Position exchangeId(String exchangeId); @javax.annotation.Nullable @ApiModelProperty(example = "KRAKEN", value = "Exchange identifier used to identify the routing destination.") String getExchangeId(); void setExchangeId(String...
@Test public void dataTest() { }
OrdersApi { public Message v1OrdersCancelAllPost(OrderCancelAllRequest orderCancelAllRequest) throws ApiException { ApiResponse<Message> localVarResp = v1OrdersCancelAllPostWithHttpInfo(orderCancelAllRequest); return localVarResp.getData(); } OrdersApi(); OrdersApi(ApiClient apiClient); ApiClient getApiClient(); void ...
@Test public void v1OrdersCancelAllPostTest() throws ApiException { OrderCancelAllRequest orderCancelAllRequest = null; Message response = api.v1OrdersCancelAllPost(orderCancelAllRequest); }
ValidationError { public ValidationError title(String title) { this.title = title; return this; } ValidationError type(String type); @javax.annotation.Nullable @ApiModelProperty(example = "https://tools.ietf.org/html/rfc7231#section-6.5.1", value = "") String getType(); void setType(String type); ValidationError title...
@Test public void titleTest() { }
OrdersApi { public OrderExecutionReport v1OrdersCancelPost(OrderCancelSingleRequest orderCancelSingleRequest) throws ApiException { ApiResponse<OrderExecutionReport> localVarResp = v1OrdersCancelPostWithHttpInfo(orderCancelSingleRequest); return localVarResp.getData(); } OrdersApi(); OrdersApi(ApiClient apiClient); Ap...
@Test public void v1OrdersCancelPostTest() throws ApiException { OrderCancelSingleRequest orderCancelSingleRequest = null; OrderExecutionReport response = api.v1OrdersCancelPost(orderCancelSingleRequest); }
OrdersApi { public List<OrderExecutionReport> v1OrdersGet(String exchangeId) throws ApiException { ApiResponse<List<OrderExecutionReport>> localVarResp = v1OrdersGetWithHttpInfo(exchangeId); return localVarResp.getData(); } OrdersApi(); OrdersApi(ApiClient apiClient); ApiClient getApiClient(); void setApiClient(ApiCli...
@Test public void v1OrdersGetTest() throws ApiException { String exchangeId = null; List<OrderExecutionReport> response = api.v1OrdersGet(exchangeId); }
OrdersApi { public OrderExecutionReport v1OrdersPost(OrderNewSingleRequest orderNewSingleRequest) throws ApiException { ApiResponse<OrderExecutionReport> localVarResp = v1OrdersPostWithHttpInfo(orderNewSingleRequest); return localVarResp.getData(); } OrdersApi(); OrdersApi(ApiClient apiClient); ApiClient getApiClient(...
@Test public void v1OrdersPostTest() throws ApiException { OrderNewSingleRequest orderNewSingleRequest = null; OrderExecutionReport response = api.v1OrdersPost(orderNewSingleRequest); }
OrdersApi { public OrderExecutionReport v1OrdersStatusClientOrderIdGet(String clientOrderId) throws ApiException { ApiResponse<OrderExecutionReport> localVarResp = v1OrdersStatusClientOrderIdGetWithHttpInfo(clientOrderId); return localVarResp.getData(); } OrdersApi(); OrdersApi(ApiClient apiClient); ApiClient getApiCl...
@Test public void v1OrdersStatusClientOrderIdGetTest() throws ApiException { String clientOrderId = null; OrderExecutionReport response = api.v1OrdersStatusClientOrderIdGet(clientOrderId); }
BalancesApi { public List<Balance> v1BalancesGet(String exchangeId) throws ApiException { ApiResponse<List<Balance>> localVarResp = v1BalancesGetWithHttpInfo(exchangeId); return localVarResp.getData(); } BalancesApi(); BalancesApi(ApiClient apiClient); ApiClient getApiClient(); void setApiClient(ApiClient apiClient); ...
@Test public void v1BalancesGetTest() throws ApiException { String exchangeId = null; List<Balance> response = api.v1BalancesGet(exchangeId); }
PositionsApi { public List<Position> v1PositionsGet(String exchangeId) throws ApiException { ApiResponse<List<Position>> localVarResp = v1PositionsGetWithHttpInfo(exchangeId); return localVarResp.getData(); } PositionsApi(); PositionsApi(ApiClient apiClient); ApiClient getApiClient(); void setApiClient(ApiClient apiCl...
@Test public void v1PositionsGetTest() throws ApiException { String exchangeId = null; List<Position> response = api.v1PositionsGet(exchangeId); }
ValidationError { public ValidationError status(BigDecimal status) { this.status = status; return this; } ValidationError type(String type); @javax.annotation.Nullable @ApiModelProperty(example = "https://tools.ietf.org/html/rfc7231#section-6.5.1", value = "") String getType(); void setType(String type); ValidationErr...
@Test public void statusTest() { }
ValidationError { public ValidationError traceId(String traceId) { this.traceId = traceId; return this; } ValidationError type(String type); @javax.annotation.Nullable @ApiModelProperty(example = "https://tools.ietf.org/html/rfc7231#section-6.5.1", value = "") String getType(); void setType(String type); ValidationErr...
@Test public void traceIdTest() { }
RunListBuilder { public List<String> build() { return ImmutableList.copyOf(list); } RunListBuilder addRecipe(String recipe); RunListBuilder addRecipes(String... recipes); RunListBuilder addRole(String role); RunListBuilder addRoles(String... roles); List<String> build(); }
@Test public void testNoneRecipe() { RunListBuilder options = new RunListBuilder(); assertEquals(options.build(), ImmutableList.<String> of()); }
ChefApiErrorRetryHandler implements HttpRetryHandler { public boolean shouldRetryRequest(HttpCommand command, HttpResponse response) { if (command.getFailureCount() > retryCountLimit) return false; if (response.getStatusCode() == 400 && command.getCurrentRequest().getMethod().equals("PUT") && command.getCurrentRequest(...
@Test public void test401DoesNotRetry() { HttpCommand command = createMock(HttpCommand.class); HttpResponse response = createMock(HttpResponse.class); BackoffLimitedRetryHandler retry = createMock(BackoffLimitedRetryHandler.class); expect(command.getFailureCount()).andReturn(0); expect(response.getStatusCode()).andRetu...
BaseChefService implements ChefService { @VisibleForTesting String buildBootstrapConfiguration(Iterable<String> runList, Optional<JsonBall> jsonAttributes) { checkNotNull(runList, "runList must not be null"); checkNotNull(jsonAttributes, "jsonAttributes must not be null"); Map<String, Object> bootstrapConfig = Maps.new...
@Test(expectedExceptions = NullPointerException.class, expectedExceptionsMessageRegExp = "runList must not be null") public void testBuildBootstrapConfigurationWithNullRunlist() { chefService.buildBootstrapConfiguration(null, null); } @Test(expectedExceptions = NullPointerException.class, expectedExceptionsMessageRegEx...
GroupToBootScript implements Function<String, Statement> { public Statement apply(String group) { checkNotNull(group, "group"); String validatorClientName = validatorName.get(); PrivateKey validatorKey = validatorCredential.get(); JsonBall bootstrapConfig = null; try { bootstrapConfig = bootstrapConfigForGroup.load(gro...
@Test(expectedExceptions = IllegalStateException.class) public void testMustHaveValidatorName() { GroupToBootScript fn = new GroupToBootScript(Suppliers.ofInstance(URI.create("http: CacheLoader.from(Functions.forMap(ImmutableMap.<String, DatabagItem> of())), installChefGems, Optional.<String> absent(), validatorCredent...
ParseErrorFromJsonOrReturnBody implements Function<HttpResponse, String> { @Override public String apply(HttpResponse response) { String content = returnStringIf200.apply(response); if (content == null) return null; return parse(content); } @Inject ParseErrorFromJsonOrReturnBody(ReturnStringIf2xx returnStringIf200); @...
@Test public void testApplyInputStreamDetails() throws UnknownHostException { InputStream is = Strings2 .toInputStream("{\"error\":[\"invalid tarball: tarball root must contain java-bytearray\"]}"); ParseErrorFromJsonOrReturnBody parser = new ParseErrorFromJsonOrReturnBody(new ReturnStringIf2xx()); String response = pa...
BootstrapConfigForGroup implements Function<String, DatabagItem> { @Override public DatabagItem apply(String from) { DatabagItem bootstrapConfig = api.getDatabagItem(databag, from); checkState(bootstrapConfig != null, "databag item %s/%s not found", databag, from); return bootstrapConfig; } @Inject BootstrapConfigForG...
@Test(expectedExceptions = IllegalStateException.class) public void testWhenNoDatabagItem() throws IOException { ChefApi chefApi = createMock(ChefApi.class); Client client = createMock(Client.class); BootstrapConfigForGroup fn = new BootstrapConfigForGroup("jclouds", chefApi); expect(chefApi.getDatabagItem("jclouds", "...
RunListForGroup implements Function<String, List<String>> { @Override public List<String> apply(String from) { DatabagItem bootstrapConfig = bootstrapConfigForGroup.apply(from); Map<String, JsonBall> config = json.fromJson(bootstrapConfig.toString(), BootstrapConfigForGroup.BOOTSTRAP_CONFIG_TYPE); JsonBall runlist = co...
@Test(expectedExceptions = IllegalStateException.class) public void testWhenNoDatabagItem() throws IOException { ChefApi chefApi = createMock(ChefApi.class); Client client = createMock(Client.class); RunListForGroup fn = new RunListForGroup(new BootstrapConfigForGroup("jclouds", chefApi), json); expect(chefApi.getDatab...