()
| 2399 | } |
| 2400 | |
| 2401 | public java.util.concurrent.CompletableFuture<Object> testWoo() |
| 2402 | { |
| 2403 | |
| 2404 | return java.util.concurrent.CompletableFuture.supplyAsync(() -> { |
| 2405 | |
| 2406 | Exchange exchange = this.initOfflineExchange("woo"); |
| 2407 | // spot test |
| 2408 | Object id = "bc830de7-50f3-460b-9ee0-f430f83f9dad"; |
| 2409 | Object spotOrderRequest = null; |
| 2410 | try |
| 2411 | { |
| 2412 | (exchange.createOrder("BTC/USDT", "limit", "buy", 1, 20000)).join(); |
| 2413 | } catch(Exception e) |
| 2414 | { |
| 2415 | spotOrderRequest = jsonParse(exchange.last_request_body); |
| 2416 | } |
| 2417 | Object brokerId = Helpers.GetValue(spotOrderRequest, "broker_id"); |
| 2418 | Object idString = String.valueOf(id); |
| 2419 | Assert(((String)brokerId).startsWith(((String)idString)), Helpers.add(Helpers.add(Helpers.add("woo - broker_id: ", brokerId), " does not start with id: "), idString)); |
| 2420 | // swap test |
| 2421 | Object stopOrderRequest = null; |
| 2422 | try |
| 2423 | { |
| 2424 | (exchange.createOrder("BTC/USDT:USDT", "limit", "buy", 1, 20000, new java.util.HashMap<String, Object>() {{ |
| 2425 | put( "stopPrice", 30000 ); |
| 2426 | }})).join(); |
| 2427 | } catch(Exception e) |
| 2428 | { |
| 2429 | stopOrderRequest = jsonParse(exchange.last_request_body); |
| 2430 | } |
| 2431 | Object clientOrderIdStop = Helpers.GetValue(stopOrderRequest, "brokerId"); |
| 2432 | Assert(((String)clientOrderIdStop).startsWith(((String)idString)), Helpers.add(Helpers.add(Helpers.add("woo - brokerId: ", clientOrderIdStop), " does not start with id: "), idString)); |
| 2433 | if (!Helpers.isTrue(isSync())) |
| 2434 | { |
| 2435 | (close(exchange)).join(); |
| 2436 | } |
| 2437 | return true; |
| 2438 | }); |
| 2439 | |
| 2440 | } |
| 2441 | |
| 2442 | public java.util.concurrent.CompletableFuture<Object> testBitmart() |
| 2443 | { |
no test coverage detected