Skip to content

Commit 8bb4b74

Browse files
authored
Control plane tests (batch 3) (#274)
* Add CP service tests * Add create/delete session tests * Add create/delete session tests * Use converted S3 error
1 parent 8435910 commit 8bb4b74

File tree

5 files changed

+320
-91
lines changed

5 files changed

+320
-91
lines changed

crates/control_plane/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ uuid = { workspace = true }
4848

4949
[dev-dependencies]
5050
slatedb = { workspace = true }
51+
mockall = { version = "0.13.1" }
5152

5253
[lints]
5354
workspace = true

crates/control_plane/src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ pub enum ControlPlaneError {
9191
UnsupportedAuthenticationMethod { method: String },
9292

9393
#[snafu(display("Invalid or missing credentials"))]
94-
CredentialsValidationFailed,
94+
InvalidCredentials,
9595

9696
#[snafu(display("Invalid TLS configuration: {source}"))]
9797
InvalidTLSConfiguration {

crates/control_plane/src/models/mod.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,20 @@ pub struct StorageProfileCreateRequest {
9898
pub validate_credentials: Option<bool>,
9999
}
100100

101+
impl Default for StorageProfileCreateRequest {
102+
fn default() -> Self {
103+
Self {
104+
r#type: CloudProvider::FS,
105+
region: None,
106+
bucket: None,
107+
credentials: None,
108+
sts_role_arn: None,
109+
endpoint: None,
110+
validate_credentials: None,
111+
}
112+
}
113+
}
114+
101115
impl TryFrom<&StorageProfileCreateRequest> for StorageProfile {
102116
type Error = ControlPlaneModelError;
103117

0 commit comments

Comments
 (0)