Skip to content

Commit

Permalink
#feature - Added a test for the SqlServerAuth integrated auth option
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRustifyer committed Apr 10, 2023
1 parent f9bcf68 commit fbbb206
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion canyon_connection/src/datasources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ fn load_ds_config_from_array() {
[canyon_sql]
datasources = [
{name = 'PostgresDS', auth = { postgresql = { basic = { username = "postgres", password = "postgres" } } }, properties.host = 'localhost', properties.db_name = 'triforce', properties.migrations='enabled' },
{name = 'SqlServerDS', auth = { sqlserver = { basic = { username = "sa", password = "SqlServer-10" } } }, properties.host = '192.168.0.250.1', properties.port = 3340, properties.db_name = 'triforce2', properties.migrations='disabled' }
{name = 'SqlServerDS', auth = { sqlserver = { basic = { username = "sa", password = "SqlServer-10" } } }, properties.host = '192.168.0.250.1', properties.port = 3340, properties.db_name = 'triforce2', properties.migrations='disabled' },
{name = 'SqlServerDS', auth = { sqlserver = { integrated = {} } }, properties.host = '192.168.0.250.1', properties.port = 3340, properties.db_name = 'triforce2', properties.migrations='disabled' }
]
"#;

Expand All @@ -18,6 +19,7 @@ fn load_ds_config_from_array() {

let ds_0 = &config.canyon_sql.datasources[0];
let ds_1 = &config.canyon_sql.datasources[1];
let ds_2 = &config.canyon_sql.datasources[2];

assert_eq!(ds_0.name, "PostgresDS");
assert_eq!(ds_0.get_db_type(), DatabaseType::PostgreSql);
Expand Down Expand Up @@ -46,6 +48,8 @@ fn load_ds_config_from_array() {
assert_eq!(ds_1.properties.port, Some(3340));
assert_eq!(ds_1.properties.db_name, "triforce2");
assert_eq!(ds_1.properties.migrations, Some(Migrations::Disabled));

assert_eq!(ds_2.auth, Auth::SqlServer(SqlServerAuth::Integrated))
}
///
#[derive(Deserialize, Debug, Clone)]
Expand Down

0 comments on commit fbbb206

Please sign in to comment.