Skip to content

Commit 089cc8c

Browse files
committed
ci: fix ci environment issues
1 parent 6149514 commit 089cc8c

File tree

12 files changed

+56
-14
lines changed

12 files changed

+56
-14
lines changed

src/client/builder.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,7 @@ impl ClientBuilder<HasUrl, HasCredentials> {
744744
mod tests {
745745
use super::*;
746746
use crate::auth::{BearerCredentialsConfig, ClientCredentialsConfig, Ed25519PrivateKey};
747+
use crate::transport::mock::MockTransport;
747748

748749
#[test]
749750
fn test_builder_typestate() {
@@ -799,10 +800,11 @@ mod tests {
799800
#[tokio::test]
800801
async fn test_build_with_client_credentials() {
801802
let key = Ed25519PrivateKey::generate();
803+
let mock_transport = Arc::new(MockTransport::new());
802804
let result = ClientBuilder::new()
803805
.url("https://api.example.com")
804806
.credentials(ClientCredentialsConfig::new("client_id", key))
805-
.build()
807+
.build_with_transport(mock_transport)
806808
.await;
807809

808810
assert!(result.is_ok());
@@ -822,6 +824,7 @@ mod tests {
822824
assert_eq!(builder.timeout, Some(Duration::from_secs(60)));
823825
}
824826

827+
#[cfg(feature = "rest")]
825828
#[tokio::test]
826829
async fn test_build_with_shutdown() {
827830
let result = ClientBuilder::new()

src/client/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,12 +549,15 @@ impl std::fmt::Debug for OrganizationClient {
549549
mod tests {
550550
use super::*;
551551
use crate::auth::BearerCredentialsConfig;
552+
use crate::transport::mock::MockTransport;
553+
use std::sync::Arc;
552554

553555
async fn create_test_client() -> Client {
556+
let mock_transport = Arc::new(MockTransport::new());
554557
Client::builder()
555558
.url("https://api.example.com")
556559
.credentials(BearerCredentialsConfig::new("test"))
557-
.build()
560+
.build_with_transport(mock_transport)
558561
.await
559562
.unwrap()
560563
}

src/control/account.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,12 +524,15 @@ impl std::fmt::Debug for SessionsClient {
524524
mod tests {
525525
use super::*;
526526
use crate::auth::BearerCredentialsConfig;
527+
use crate::transport::mock::MockTransport;
528+
use std::sync::Arc;
527529

528530
async fn create_test_client() -> Client {
531+
let mock_transport = Arc::new(MockTransport::new());
529532
Client::builder()
530533
.url("https://api.example.com")
531534
.credentials(BearerCredentialsConfig::new("test"))
532-
.build()
535+
.build_with_transport(mock_transport)
533536
.await
534537
.unwrap()
535538
}

src/control/audit.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,12 +733,15 @@ impl ExportAuditLogsRequest {
733733
mod tests {
734734
use super::*;
735735
use crate::auth::BearerCredentialsConfig;
736+
use crate::transport::mock::MockTransport;
737+
use std::sync::Arc;
736738

737739
async fn create_test_client() -> Client {
740+
let mock_transport = Arc::new(MockTransport::new());
738741
Client::builder()
739742
.url("https://api.example.com")
740743
.credentials(BearerCredentialsConfig::new("test"))
741-
.build()
744+
.build_with_transport(mock_transport)
742745
.await
743746
.unwrap()
744747
}

src/control/clients.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,12 +711,15 @@ impl RotateCertificateRequest {
711711
mod tests {
712712
use super::*;
713713
use crate::auth::BearerCredentialsConfig;
714+
use crate::transport::mock::MockTransport;
715+
use std::sync::Arc;
714716

715717
async fn create_test_client() -> Client {
718+
let mock_transport = Arc::new(MockTransport::new());
716719
Client::builder()
717720
.url("https://api.example.com")
718721
.credentials(BearerCredentialsConfig::new("test"))
719-
.build()
722+
.build_with_transport(mock_transport)
720723
.await
721724
.unwrap()
722725
}

src/control/jwks.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,12 +352,15 @@ impl Jwk {
352352
mod tests {
353353
use super::*;
354354
use crate::auth::BearerCredentialsConfig;
355+
use crate::transport::mock::MockTransport;
356+
use std::sync::Arc;
355357

356358
async fn create_test_client() -> Client {
359+
let mock_transport = Arc::new(MockTransport::new());
357360
Client::builder()
358361
.url("https://api.example.com")
359362
.credentials(BearerCredentialsConfig::new("test"))
360-
.build()
363+
.build_with_transport(mock_transport)
361364
.await
362365
.unwrap()
363366
}

src/control/members.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,12 +667,15 @@ impl std::future::IntoFuture for ListInvitationsRequest {
667667
mod tests {
668668
use super::*;
669669
use crate::auth::BearerCredentialsConfig;
670+
use crate::transport::mock::MockTransport;
671+
use std::sync::Arc;
670672

671673
async fn create_test_client() -> Client {
674+
let mock_transport = Arc::new(MockTransport::new());
672675
Client::builder()
673676
.url("https://api.example.com")
674677
.credentials(BearerCredentialsConfig::new("test"))
675-
.build()
678+
.build_with_transport(mock_transport)
676679
.await
677680
.unwrap()
678681
}

src/control/organizations.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,12 +474,15 @@ impl std::future::IntoFuture for DeleteOrganizationRequest {
474474
mod tests {
475475
use super::*;
476476
use crate::auth::BearerCredentialsConfig;
477+
use crate::transport::mock::MockTransport;
478+
use std::sync::Arc;
477479

478480
async fn create_test_client() -> Client {
481+
let mock_transport = Arc::new(MockTransport::new());
479482
Client::builder()
480483
.url("https://api.example.com")
481484
.credentials(BearerCredentialsConfig::new("test"))
482-
.build()
485+
.build_with_transport(mock_transport)
483486
.await
484487
.unwrap()
485488
}

src/control/schemas.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,12 +579,15 @@ impl std::future::IntoFuture for ListSchemasRequest {
579579
mod tests {
580580
use super::*;
581581
use crate::auth::BearerCredentialsConfig;
582+
use crate::transport::mock::MockTransport;
583+
use std::sync::Arc;
582584

583585
async fn create_test_client() -> Client {
586+
let mock_transport = Arc::new(MockTransport::new());
584587
Client::builder()
585588
.url("https://api.example.com")
586589
.credentials(BearerCredentialsConfig::new("test"))
587-
.build()
590+
.build_with_transport(mock_transport)
588591
.await
589592
.unwrap()
590593
}

src/control/teams.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,12 +530,15 @@ impl std::future::IntoFuture for ListTeamMembersRequest {
530530
mod tests {
531531
use super::*;
532532
use crate::auth::BearerCredentialsConfig;
533+
use crate::transport::mock::MockTransport;
534+
use std::sync::Arc;
533535

534536
async fn create_test_client() -> Client {
537+
let mock_transport = Arc::new(MockTransport::new());
535538
Client::builder()
536539
.url("https://api.example.com")
537540
.credentials(BearerCredentialsConfig::new("test"))
538-
.build()
541+
.build_with_transport(mock_transport)
539542
.await
540543
.unwrap()
541544
}

0 commit comments

Comments
 (0)