message: test: add test to verify correct param serialization
diff: @@ -363,4 +363,71 @@ mod tests {
  assert_eq!(to_snakecase("UPPER").as_str(), "upper");
  assert_eq!(to_snakecase("lower").as_str(), "lower");
  }
  +
  + #[cfg(feature = "async")]
  + #[tokio::test]
  + async fn list() {
  + use httpmock::Method::GET;
  + use httpmock::MockServer;
  +
  + use crate::Client;
  + use crate::{Customer, ListCustomers};
  +
  + // Start a lightweight mock server.
  + let server = MockServer::start_async().await;
  +
  + let client = Client::from_url(&*server.url("/"), "fake_key");
  +
  + let next_item = server.mock(|when, then| {
  + when.method(GET).path("/v1/customers").query_param("starting_after", "cus_1");
  + then.status(200).body(
  + r#"{"object": "list", "data": [{
  + "id": "cus_2",
  + "object": "customer",
  + "balance": 0,
  + "created": 1649316731,
  + "currency": "gbp",
  + "delinquent": false,
  + "email": null,
  + "invoice_prefix": "4AF7482",
  + "invoice_settings": {},
  + "livemode": false,
  + "metadata": {},
  + "preferred_locales": [],
  + "tax_exempt": "none"
  + }], "has_more": true, "url": "/v1/customers"}"#,
  + );
  + });
  +
  + let first_item = server.mock(|when, then| {
  + when.method(GET).path("/v1/customers");
  + then.status(200).body(
  + r#"{"object": "list", "data": [{
  + "id": "cus_1",
  + "object": "customer",
  + "balance": 0,
  + "created": 1649316731,
  + "currency": "gbp",
  + "delinquent": false,
  + "invoice_prefix": "4AF7482",
  + "invoice_settings": {},
  + "livemode": false,
  + "metadata": {},
  + "preferred_locales": [],
  + "tax_exempt": "none"
  + }], "has_more": true, "url": "/v1/customers"}"#,
  + );
  + });
  +
  + let res = Customer::list(&client, ListCustomers::new()).await.unwrap();
  +
  + println!("{:?}", res);
  +
  + let res2 = res.next(&client).await.unwrap();
  +
  + println!("{:?}", res2);
  +
  + first_item.assert_hits_async(1).await;
  + next_item.assert_hits_async(1).await;
  + }
  }
  