binance-sdk 45.0.0

This is a lightweight library that works as a connector to the Binance public API.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
/*
 * Binance VIP Loan REST API
 *
 * OpenAPI Specification for the Binance VIP Loan REST API
 *
 * The version of the OpenAPI document: 1.0.0
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

#![allow(unused_imports)]
use async_trait::async_trait;
use derive_builder::Builder;
use reqwest;
use rust_decimal::prelude::*;
use serde::{Deserialize, Serialize};
use serde_json::{Value, json};
use std::collections::BTreeMap;

use crate::common::{
    config::ConfigurationRestApi,
    models::{ParamBuildError, RestApiResponse},
    utils::send_request,
};
use crate::vip_loan::rest_api::models;

const HAS_TIME_UNIT: bool = false;

#[async_trait]
pub trait TradeApi: Send + Sync {
    async fn vip_loan_borrow(
        &self,
        params: VipLoanBorrowParams,
    ) -> anyhow::Result<RestApiResponse<models::VipLoanBorrowResponse>>;
    async fn vip_loan_renew(
        &self,
        params: VipLoanRenewParams,
    ) -> anyhow::Result<RestApiResponse<models::VipLoanRenewResponse>>;
    async fn vip_loan_repay(
        &self,
        params: VipLoanRepayParams,
    ) -> anyhow::Result<RestApiResponse<models::VipLoanRepayResponse>>;
}

#[derive(Debug, Clone)]
pub struct TradeApiClient {
    configuration: ConfigurationRestApi,
}

impl TradeApiClient {
    pub fn new(configuration: ConfigurationRestApi) -> Self {
        Self { configuration }
    }
}

/// Request parameters for the [`vip_loan_borrow`] operation.
///
/// This struct holds all of the inputs you can pass when calling
/// [`vip_loan_borrow`](#method.vip_loan_borrow).
#[derive(Clone, Debug, Builder)]
#[builder(pattern = "owned", build_fn(error = "ParamBuildError"))]
pub struct VipLoanBorrowParams {
    ///
    /// The `loan_account_id` parameter.
    ///
    /// This field is **required.
    #[builder(setter(into))]
    pub loan_account_id: i64,
    ///
    /// The `loan_coin` parameter.
    ///
    /// This field is **required.
    #[builder(setter(into))]
    pub loan_coin: String,
    ///
    /// The `loan_amount` parameter.
    ///
    /// This field is **required.
    #[builder(setter(into))]
    pub loan_amount: rust_decimal::Decimal,
    /// Multiple split by `,`
    ///
    /// This field is **required.
    #[builder(setter(into))]
    pub collateral_account_id: String,
    /// Multiple split by `,`
    ///
    /// This field is **required.
    #[builder(setter(into))]
    pub collateral_coin: String,
    /// Default: TRUE. TRUE : flexible rate; FALSE: fixed rate
    ///
    /// This field is **required.
    #[builder(setter(into))]
    pub is_flexible_rate: bool,
    /// Mandatory for fixed rate. Optional for fixed interest rate. Eg: 30/60 days
    ///
    /// This field is **optional.
    #[builder(setter(into), default)]
    pub loan_term: Option<i64>,
    ///
    /// The `recv_window` parameter.
    ///
    /// This field is **optional.
    #[builder(setter(into), default)]
    pub recv_window: Option<i64>,
}

impl VipLoanBorrowParams {
    /// Create a builder for [`vip_loan_borrow`].
    ///
    /// Required parameters:
    ///
    /// * `loan_account_id` — i64
    /// * `loan_coin` — String
    /// * `loan_amount` — `rust_decimal::Decimal`
    /// * `collateral_account_id` — Multiple split by `,`
    /// * `collateral_coin` — Multiple split by `,`
    /// * `is_flexible_rate` — Default: TRUE. TRUE : flexible rate; FALSE: fixed rate
    ///
    #[must_use]
    pub fn builder(
        loan_account_id: i64,
        loan_coin: String,
        loan_amount: rust_decimal::Decimal,
        collateral_account_id: String,
        collateral_coin: String,
        is_flexible_rate: bool,
    ) -> VipLoanBorrowParamsBuilder {
        VipLoanBorrowParamsBuilder::default()
            .loan_account_id(loan_account_id)
            .loan_coin(loan_coin)
            .loan_amount(loan_amount)
            .collateral_account_id(collateral_account_id)
            .collateral_coin(collateral_coin)
            .is_flexible_rate(is_flexible_rate)
    }
}
/// Request parameters for the [`vip_loan_renew`] operation.
///
/// This struct holds all of the inputs you can pass when calling
/// [`vip_loan_renew`](#method.vip_loan_renew).
#[derive(Clone, Debug, Builder)]
#[builder(pattern = "owned", build_fn(error = "ParamBuildError"))]
pub struct VipLoanRenewParams {
    ///
    /// The `order_id` parameter.
    ///
    /// This field is **required.
    #[builder(setter(into))]
    pub order_id: i64,
    /// 30/60 days
    ///
    /// This field is **required.
    #[builder(setter(into))]
    pub loan_term: i64,
    ///
    /// The `recv_window` parameter.
    ///
    /// This field is **optional.
    #[builder(setter(into), default)]
    pub recv_window: Option<i64>,
}

impl VipLoanRenewParams {
    /// Create a builder for [`vip_loan_renew`].
    ///
    /// Required parameters:
    ///
    /// * `order_id` — i64
    /// * `loan_term` — 30/60 days
    ///
    #[must_use]
    pub fn builder(order_id: i64, loan_term: i64) -> VipLoanRenewParamsBuilder {
        VipLoanRenewParamsBuilder::default()
            .order_id(order_id)
            .loan_term(loan_term)
    }
}
/// Request parameters for the [`vip_loan_repay`] operation.
///
/// This struct holds all of the inputs you can pass when calling
/// [`vip_loan_repay`](#method.vip_loan_repay).
#[derive(Clone, Debug, Builder)]
#[builder(pattern = "owned", build_fn(error = "ParamBuildError"))]
pub struct VipLoanRepayParams {
    ///
    /// The `order_id` parameter.
    ///
    /// This field is **required.
    #[builder(setter(into))]
    pub order_id: i64,
    ///
    /// The `amount` parameter.
    ///
    /// This field is **required.
    #[builder(setter(into))]
    pub amount: rust_decimal::Decimal,
    ///
    /// The `recv_window` parameter.
    ///
    /// This field is **optional.
    #[builder(setter(into), default)]
    pub recv_window: Option<i64>,
}

impl VipLoanRepayParams {
    /// Create a builder for [`vip_loan_repay`].
    ///
    /// Required parameters:
    ///
    /// * `order_id` — i64
    /// * `amount` — `rust_decimal::Decimal`
    ///
    #[must_use]
    pub fn builder(order_id: i64, amount: rust_decimal::Decimal) -> VipLoanRepayParamsBuilder {
        VipLoanRepayParamsBuilder::default()
            .order_id(order_id)
            .amount(amount)
    }
}

#[async_trait]
impl TradeApi for TradeApiClient {
    async fn vip_loan_borrow(
        &self,
        params: VipLoanBorrowParams,
    ) -> anyhow::Result<RestApiResponse<models::VipLoanBorrowResponse>> {
        let VipLoanBorrowParams {
            loan_account_id,
            loan_coin,
            loan_amount,
            collateral_account_id,
            collateral_coin,
            is_flexible_rate,
            loan_term,
            recv_window,
        } = params;

        let mut query_params = BTreeMap::new();
        let body_params = BTreeMap::new();

        query_params.insert("loanAccountId".to_string(), json!(loan_account_id));

        query_params.insert("loanCoin".to_string(), json!(loan_coin));

        query_params.insert("loanAmount".to_string(), json!(loan_amount));

        query_params.insert(
            "collateralAccountId".to_string(),
            json!(collateral_account_id),
        );

        query_params.insert("collateralCoin".to_string(), json!(collateral_coin));

        query_params.insert("isFlexibleRate".to_string(), json!(is_flexible_rate));

        if let Some(rw) = loan_term {
            query_params.insert("loanTerm".to_string(), json!(rw));
        }

        if let Some(rw) = recv_window {
            query_params.insert("recvWindow".to_string(), json!(rw));
        }

        send_request::<models::VipLoanBorrowResponse>(
            &self.configuration,
            "/sapi/v1/loan/vip/borrow",
            reqwest::Method::POST,
            query_params,
            body_params,
            if HAS_TIME_UNIT {
                self.configuration.time_unit
            } else {
                None
            },
            true,
        )
        .await
    }

    async fn vip_loan_renew(
        &self,
        params: VipLoanRenewParams,
    ) -> anyhow::Result<RestApiResponse<models::VipLoanRenewResponse>> {
        let VipLoanRenewParams {
            order_id,
            loan_term,
            recv_window,
        } = params;

        let mut query_params = BTreeMap::new();
        let body_params = BTreeMap::new();

        query_params.insert("orderId".to_string(), json!(order_id));

        query_params.insert("loanTerm".to_string(), json!(loan_term));

        if let Some(rw) = recv_window {
            query_params.insert("recvWindow".to_string(), json!(rw));
        }

        send_request::<models::VipLoanRenewResponse>(
            &self.configuration,
            "/sapi/v1/loan/vip/renew",
            reqwest::Method::POST,
            query_params,
            body_params,
            if HAS_TIME_UNIT {
                self.configuration.time_unit
            } else {
                None
            },
            true,
        )
        .await
    }

    async fn vip_loan_repay(
        &self,
        params: VipLoanRepayParams,
    ) -> anyhow::Result<RestApiResponse<models::VipLoanRepayResponse>> {
        let VipLoanRepayParams {
            order_id,
            amount,
            recv_window,
        } = params;

        let mut query_params = BTreeMap::new();
        let body_params = BTreeMap::new();

        query_params.insert("orderId".to_string(), json!(order_id));

        query_params.insert("amount".to_string(), json!(amount));

        if let Some(rw) = recv_window {
            query_params.insert("recvWindow".to_string(), json!(rw));
        }

        send_request::<models::VipLoanRepayResponse>(
            &self.configuration,
            "/sapi/v1/loan/vip/repay",
            reqwest::Method::POST,
            query_params,
            body_params,
            if HAS_TIME_UNIT {
                self.configuration.time_unit
            } else {
                None
            },
            true,
        )
        .await
    }
}

#[cfg(all(test, feature = "vip_loan"))]
mod tests {
    use super::*;
    use crate::TOKIO_SHARED_RT;
    use crate::{errors::ConnectorError, models::DataFuture, models::RestApiRateLimit};
    use async_trait::async_trait;
    use std::collections::HashMap;

    struct DummyRestApiResponse<T> {
        inner: Box<dyn FnOnce() -> DataFuture<Result<T, ConnectorError>> + Send + Sync>,
        status: u16,
        headers: HashMap<String, String>,
        rate_limits: Option<Vec<RestApiRateLimit>>,
    }

    impl<T> From<DummyRestApiResponse<T>> for RestApiResponse<T> {
        fn from(dummy: DummyRestApiResponse<T>) -> Self {
            Self {
                data_fn: dummy.inner,
                status: dummy.status,
                headers: dummy.headers,
                rate_limits: dummy.rate_limits,
            }
        }
    }

    struct MockTradeApiClient {
        force_error: bool,
    }

    #[async_trait]
    impl TradeApi for MockTradeApiClient {
        async fn vip_loan_borrow(
            &self,
            _params: VipLoanBorrowParams,
        ) -> anyhow::Result<RestApiResponse<models::VipLoanBorrowResponse>> {
            if self.force_error {
                return Err(ConnectorError::ConnectorClientError {
                    msg: "ResponseError".to_string(),
                    code: None,
                }
                .into());
            }

            let resp_json: Value = serde_json::from_str(r#"{"loanAccountId":"12345678","requestId":"12345678","loanCoin":"BTC","isFlexibleRate":"Yes","loanAmount":"100.55","collateralAccountId":"12345678,12345678,12345678","collateralCoin":"BUSD,USDT,ETH","loanTerm":"30"}"#).unwrap();
            let dummy_response: models::VipLoanBorrowResponse =
                serde_json::from_value(resp_json.clone())
                    .expect("should parse into models::VipLoanBorrowResponse");

            let dummy = DummyRestApiResponse {
                inner: Box::new(move || Box::pin(async move { Ok(dummy_response) })),
                status: 200,
                headers: HashMap::new(),
                rate_limits: None,
            };

            Ok(dummy.into())
        }

        async fn vip_loan_renew(
            &self,
            _params: VipLoanRenewParams,
        ) -> anyhow::Result<RestApiResponse<models::VipLoanRenewResponse>> {
            if self.force_error {
                return Err(ConnectorError::ConnectorClientError {
                    msg: "ResponseError".to_string(),
                    code: None,
                }
                .into());
            }

            let resp_json: Value = serde_json::from_str(r#"{"loanAccountId":"12345678","loanCoin":"BTC","loanAmount":"100.55","collateralAccountId":"12345677,12345678,12345679","collateralCoin":"BUSD,USDT,ETH","loanTerm":"30"}"#).unwrap();
            let dummy_response: models::VipLoanRenewResponse =
                serde_json::from_value(resp_json.clone())
                    .expect("should parse into models::VipLoanRenewResponse");

            let dummy = DummyRestApiResponse {
                inner: Box::new(move || Box::pin(async move { Ok(dummy_response) })),
                status: 200,
                headers: HashMap::new(),
                rate_limits: None,
            };

            Ok(dummy.into())
        }

        async fn vip_loan_repay(
            &self,
            _params: VipLoanRepayParams,
        ) -> anyhow::Result<RestApiResponse<models::VipLoanRepayResponse>> {
            if self.force_error {
                return Err(ConnectorError::ConnectorClientError {
                    msg: "ResponseError".to_string(),
                    code: None,
                }
                .into());
            }

            let resp_json: Value = serde_json::from_str(r#"{"loanCoin":"BUSD","repayAmount":"200.5","remainingPrincipal":"100.5","remainingInterest":"0","collateralCoin":"BNB,BTC,ETH","currentLTV":"0.25","repayStatus":"Repaid"}"#).unwrap();
            let dummy_response: models::VipLoanRepayResponse =
                serde_json::from_value(resp_json.clone())
                    .expect("should parse into models::VipLoanRepayResponse");

            let dummy = DummyRestApiResponse {
                inner: Box::new(move || Box::pin(async move { Ok(dummy_response) })),
                status: 200,
                headers: HashMap::new(),
                rate_limits: None,
            };

            Ok(dummy.into())
        }
    }

    #[test]
    fn vip_loan_borrow_required_params_success() {
        TOKIO_SHARED_RT.block_on(async {
            let client = MockTradeApiClient { force_error: false };

            let params = VipLoanBorrowParams::builder(1,"loan_coin_example".to_string(),dec!(1.0),"1".to_string(),"collateral_coin_example".to_string(),true,).build().unwrap();

            let resp_json: Value = serde_json::from_str(r#"{"loanAccountId":"12345678","requestId":"12345678","loanCoin":"BTC","isFlexibleRate":"Yes","loanAmount":"100.55","collateralAccountId":"12345678,12345678,12345678","collateralCoin":"BUSD,USDT,ETH","loanTerm":"30"}"#).unwrap();
            let expected_response : models::VipLoanBorrowResponse = serde_json::from_value(resp_json.clone()).expect("should parse into models::VipLoanBorrowResponse");

            let resp = client.vip_loan_borrow(params).await.expect("Expected a response");
            let data_future = resp.data();
            let actual_response = data_future.await.unwrap();
            assert_eq!(actual_response, expected_response);
        });
    }

    #[test]
    fn vip_loan_borrow_optional_params_success() {
        TOKIO_SHARED_RT.block_on(async {
            let client = MockTradeApiClient { force_error: false };

            let params = VipLoanBorrowParams::builder(1,"loan_coin_example".to_string(),dec!(1.0),"1".to_string(),"collateral_coin_example".to_string(),true,).loan_term(789).recv_window(5000).build().unwrap();

            let resp_json: Value = serde_json::from_str(r#"{"loanAccountId":"12345678","requestId":"12345678","loanCoin":"BTC","isFlexibleRate":"Yes","loanAmount":"100.55","collateralAccountId":"12345678,12345678,12345678","collateralCoin":"BUSD,USDT,ETH","loanTerm":"30"}"#).unwrap();
            let expected_response : models::VipLoanBorrowResponse = serde_json::from_value(resp_json.clone()).expect("should parse into models::VipLoanBorrowResponse");

            let resp = client.vip_loan_borrow(params).await.expect("Expected a response");
            let data_future = resp.data();
            let actual_response = data_future.await.unwrap();
            assert_eq!(actual_response, expected_response);
        });
    }

    #[test]
    fn vip_loan_borrow_response_error() {
        TOKIO_SHARED_RT.block_on(async {
            let client = MockTradeApiClient { force_error: true };

            let params = VipLoanBorrowParams::builder(
                1,
                "loan_coin_example".to_string(),
                dec!(1.0),
                "1".to_string(),
                "collateral_coin_example".to_string(),
                true,
            )
            .build()
            .unwrap();

            match client.vip_loan_borrow(params).await {
                Ok(_) => panic!("Expected an error"),
                Err(err) => {
                    assert_eq!(err.to_string(), "Connector client error: ResponseError");
                }
            }
        });
    }

    #[test]
    fn vip_loan_renew_required_params_success() {
        TOKIO_SHARED_RT.block_on(async {
            let client = MockTradeApiClient { force_error: false };

            let params = VipLoanRenewParams::builder(1,789,).build().unwrap();

            let resp_json: Value = serde_json::from_str(r#"{"loanAccountId":"12345678","loanCoin":"BTC","loanAmount":"100.55","collateralAccountId":"12345677,12345678,12345679","collateralCoin":"BUSD,USDT,ETH","loanTerm":"30"}"#).unwrap();
            let expected_response : models::VipLoanRenewResponse = serde_json::from_value(resp_json.clone()).expect("should parse into models::VipLoanRenewResponse");

            let resp = client.vip_loan_renew(params).await.expect("Expected a response");
            let data_future = resp.data();
            let actual_response = data_future.await.unwrap();
            assert_eq!(actual_response, expected_response);
        });
    }

    #[test]
    fn vip_loan_renew_optional_params_success() {
        TOKIO_SHARED_RT.block_on(async {
            let client = MockTradeApiClient { force_error: false };

            let params = VipLoanRenewParams::builder(1,789,).recv_window(5000).build().unwrap();

            let resp_json: Value = serde_json::from_str(r#"{"loanAccountId":"12345678","loanCoin":"BTC","loanAmount":"100.55","collateralAccountId":"12345677,12345678,12345679","collateralCoin":"BUSD,USDT,ETH","loanTerm":"30"}"#).unwrap();
            let expected_response : models::VipLoanRenewResponse = serde_json::from_value(resp_json.clone()).expect("should parse into models::VipLoanRenewResponse");

            let resp = client.vip_loan_renew(params).await.expect("Expected a response");
            let data_future = resp.data();
            let actual_response = data_future.await.unwrap();
            assert_eq!(actual_response, expected_response);
        });
    }

    #[test]
    fn vip_loan_renew_response_error() {
        TOKIO_SHARED_RT.block_on(async {
            let client = MockTradeApiClient { force_error: true };

            let params = VipLoanRenewParams::builder(1, 789).build().unwrap();

            match client.vip_loan_renew(params).await {
                Ok(_) => panic!("Expected an error"),
                Err(err) => {
                    assert_eq!(err.to_string(), "Connector client error: ResponseError");
                }
            }
        });
    }

    #[test]
    fn vip_loan_repay_required_params_success() {
        TOKIO_SHARED_RT.block_on(async {
            let client = MockTradeApiClient { force_error: false };

            let params = VipLoanRepayParams::builder(1,dec!(1.0),).build().unwrap();

            let resp_json: Value = serde_json::from_str(r#"{"loanCoin":"BUSD","repayAmount":"200.5","remainingPrincipal":"100.5","remainingInterest":"0","collateralCoin":"BNB,BTC,ETH","currentLTV":"0.25","repayStatus":"Repaid"}"#).unwrap();
            let expected_response : models::VipLoanRepayResponse = serde_json::from_value(resp_json.clone()).expect("should parse into models::VipLoanRepayResponse");

            let resp = client.vip_loan_repay(params).await.expect("Expected a response");
            let data_future = resp.data();
            let actual_response = data_future.await.unwrap();
            assert_eq!(actual_response, expected_response);
        });
    }

    #[test]
    fn vip_loan_repay_optional_params_success() {
        TOKIO_SHARED_RT.block_on(async {
            let client = MockTradeApiClient { force_error: false };

            let params = VipLoanRepayParams::builder(1,dec!(1.0),).recv_window(5000).build().unwrap();

            let resp_json: Value = serde_json::from_str(r#"{"loanCoin":"BUSD","repayAmount":"200.5","remainingPrincipal":"100.5","remainingInterest":"0","collateralCoin":"BNB,BTC,ETH","currentLTV":"0.25","repayStatus":"Repaid"}"#).unwrap();
            let expected_response : models::VipLoanRepayResponse = serde_json::from_value(resp_json.clone()).expect("should parse into models::VipLoanRepayResponse");

            let resp = client.vip_loan_repay(params).await.expect("Expected a response");
            let data_future = resp.data();
            let actual_response = data_future.await.unwrap();
            assert_eq!(actual_response, expected_response);
        });
    }

    #[test]
    fn vip_loan_repay_response_error() {
        TOKIO_SHARED_RT.block_on(async {
            let client = MockTradeApiClient { force_error: true };

            let params = VipLoanRepayParams::builder(1, dec!(1.0)).build().unwrap();

            match client.vip_loan_repay(params).await {
                Ok(_) => panic!("Expected an error"),
                Err(err) => {
                    assert_eq!(err.to_string(), "Connector client error: ResponseError");
                }
            }
        });
    }
}