()
| 2167 | } |
| 2168 | |
| 2169 | public java.util.concurrent.CompletableFuture<Object> testBybit() |
| 2170 | { |
| 2171 | |
| 2172 | return java.util.concurrent.CompletableFuture.supplyAsync(() -> { |
| 2173 | |
| 2174 | Exchange exchange = this.initOfflineExchange("bybit"); |
| 2175 | Object reqHeaders = null; |
| 2176 | Object id = "CCXT"; |
| 2177 | Assert(Helpers.isEqual(Helpers.GetValue(exchange.options, "brokerId"), id), "id not in options"); |
| 2178 | try |
| 2179 | { |
| 2180 | (exchange.createOrder("BTC/USDT", "limit", "buy", 1, 20000)).join(); |
| 2181 | } catch(Exception e) |
| 2182 | { |
| 2183 | // we expect an error here, we're only interested in the headers |
| 2184 | reqHeaders = exchange.last_request_headers; |
| 2185 | } |
| 2186 | Assert(Helpers.isEqual(Helpers.GetValue(reqHeaders, "Referer"), id), Helpers.add(Helpers.add("bybit - id: ", id), " not in headers.")); |
| 2187 | if (!Helpers.isTrue(isSync())) |
| 2188 | { |
| 2189 | (close(exchange)).join(); |
| 2190 | } |
| 2191 | return true; |
| 2192 | }); |
| 2193 | |
| 2194 | } |
| 2195 | |
| 2196 | public java.util.concurrent.CompletableFuture<Object> testKucoin() |
| 2197 | { |
no test coverage detected