Skip to content

Commit

Permalink
test(config.rs): add validation check for credentials in existing tes…
Browse files Browse the repository at this point in the history
…ts to ensure proper configuration

refactor(tests): remove redundant test for validate_credentials as it is already covered in other tests
  • Loading branch information
ivancasco committed Dec 23, 2024
1 parent 0d2a450 commit 7862361
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions aws_secretsmanager_agent/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@ mod tests {
assert_eq!(config.clone().log_level(), LogLevel::Info);
assert_eq!(config.clone().http_port(), 2773);
assert_eq!(config.clone().ttl(), Duration::from_secs(300));
assert!(config.validate_credentials());
assert_eq!(
config.clone().cache_size(),
NonZeroUsize::new(1000).unwrap()
Expand Down Expand Up @@ -639,16 +640,4 @@ mod tests {
))
.unwrap();
}

/// Tests that validate_credentials defaults to true and can be overridden
#[test]
fn test_validate_credentials() {
// Test default value
let config = Config::default();
assert!(config.validate_credentials());

// Test override to false
let config = Config::new(Some("tests/resources/configs/config_file_valid.toml")).unwrap();
assert!(!config.validate_credentials());
}
}

0 comments on commit 7862361

Please sign in to comment.