@@ -31,7 +31,7 @@ function Test-ThreatDetectionDatabaseGetDefualtPolicy
31
31
32
32
# Assert
33
33
Assert-AreEqual $policy.ThreatDetectionState " New"
34
- Assert-AreEqual $policy.NotificationRecipientsEmail " "
34
+ Assert-AreEqual $policy.NotificationRecipientsEmails " "
35
35
Assert-True {$policy.EmailAdmins }
36
36
Assert-AreEqual $policy.ExcludedDetectionTypes.Length 0
37
37
}
@@ -57,12 +57,12 @@ function Test-ThreatDetectionDatabaseUpdatePolicy
57
57
{
58
58
# Test
59
59
Set-AzureRmSqlDatabaseAuditingPolicy - ResourceGroupName $params.rgname - ServerName $params.serverName - DatabaseName $params.databaseName - StorageAccountName $params.storageAccount
60
- Set-AzureRmSqlDatabaseThreatDetectionPolicy - ResourceGroupName
$params.rgname - ServerName
$params.serverName - DatabaseName
$params.databaseName - NotificationRecipientsEmail " [email protected] ;[email protected] " - EmailAdmins
$false - ExcludedDetectionType
" Successful_SQLi" , " Attempted_SQLi"
60
+ Set-AzureRmSqlDatabaseThreatDetectionPolicy - ResourceGroupName
$params.rgname - ServerName
$params.serverName - DatabaseName
$params.databaseName - NotificationRecipientsEmails " [email protected] ;[email protected] " - EmailAdmins
$false - ExcludedDetectionType
" Successful_SQLi" , " Attempted_SQLi"
61
61
$policy = Get-AzureRmSqlDatabaseThreatDetectionPolicy - ResourceGroupName $params.rgname - ServerName $params.serverName - DatabaseName $params.databaseName
62
62
63
63
# Assert
64
64
Assert-AreEqual $policy.ThreatDetectionState " Enabled"
65
- Assert-AreEqual $policy.NotificationRecipientsEmail " [email protected] ;[email protected] "
65
+ Assert-AreEqual $policy.NotificationRecipientsEmails " [email protected] ;[email protected] "
66
66
Assert-False {$policy.EmailAdmins }
67
67
Assert-AreEqual $policy.ExcludedDetectionTypes.Length 2
68
68
Assert-True {$policy.ExcludedDetectionTypes.Contains ([Microsoft.Azure.Commands.Sql.ThreatDetection.Model.DetectionType ]::Successful_SQLi)}
@@ -75,7 +75,7 @@ function Test-ThreatDetectionDatabaseUpdatePolicy
75
75
76
76
# Assert
77
77
Assert-AreEqual $policy.ThreatDetectionState " Enabled"
78
- Assert-AreEqual $policy.NotificationRecipientsEmail " [email protected] ;[email protected] "
78
+ Assert-AreEqual $policy.NotificationRecipientsEmails " [email protected] ;[email protected] "
79
79
Assert-False {$policy.EmailAdmins }
80
80
Assert-AreEqual $policy.ExcludedDetectionTypes.Length 7
81
81
Assert-True {$policy.ExcludedDetectionTypes.Contains ([Microsoft.Azure.Commands.Sql.ThreatDetection.Model.DetectionType ]::Successful_SQLi)}
@@ -93,7 +93,7 @@ function Test-ThreatDetectionDatabaseUpdatePolicy
93
93
94
94
# Assert
95
95
Assert-AreEqual $policy.ThreatDetectionState " Disabled"
96
- Assert-AreEqual $policy.NotificationRecipientsEmail " [email protected] ;[email protected] "
96
+ Assert-AreEqual $policy.NotificationRecipientsEmails " [email protected] ;[email protected] "
97
97
Assert-False {$policy.EmailAdmins }
98
98
Assert-AreEqual $policy.ExcludedDetectionTypes.Length 7
99
99
Assert-True {$policy.ExcludedDetectionTypes.Contains ([Microsoft.Azure.Commands.Sql.ThreatDetection.Model.DetectionType ]::Successful_SQLi)}
@@ -176,13 +176,13 @@ function Test-InvalidArgumentsThreatDetection
176
176
Remove-AzureRmSqlDatabaseServerAuditing - ResourceGroupName $params.rgname - ServerName $params.serverName
177
177
Assert-Throws {Set-AzureRmSqlDatabaseThreatDetectionPolicy - ResourceGroupName $params.rgname - ServerName $params.serverName - DatabaseName $params.databaseName }
178
178
179
- # Check that NotificationRecipientsEmail are in correct format
179
+ # Check that NotificationRecipientsEmails are in correct format
180
180
Set-AzureRmSqlDatabaseAuditingPolicy - ResourceGroupName $params.rgname - ServerName $params.serverName - DatabaseName $params.databaseName - StorageAccountName $params.storageAccount
181
- Assert-Throws {Set-AzureRmSqlDatabaseThreatDetectionPolicy - ResourceGroupName $params.rgname - ServerName $params.serverName - DatabaseName $params.databaseName - NotificationRecipientsEmail " kokogmail.com" }
181
+ Assert-Throws {Set-AzureRmSqlDatabaseThreatDetectionPolicy - ResourceGroupName $params.rgname - ServerName $params.serverName - DatabaseName $params.databaseName - NotificationRecipientsEmails " kokogmail.com" }
182
182
183
- # Check that EmailAdmins is not False and NotificationRecipientsEmail is not empty
183
+ # Check that EmailAdmins is not False and NotificationRecipientsEmails is not empty
184
184
Assert-Throws {Set-AzureRmSqlDatabaseThreatDetectionPolicy - ResourceGroupName $params.rgname - ServerName $params.serverName - DatabaseName $params.databaseName - EmailAdmins $false }
185
- Assert-Throws {Set-AzureRmSqlDatabaseThreatDetectionPolicy - ResourceGroupName $params.rgname - ServerName $params.serverName - DatabaseName $params.databaseName - EmailAdmins $false - NotificationRecipientsEmail " " }
185
+ Assert-Throws {Set-AzureRmSqlDatabaseThreatDetectionPolicy - ResourceGroupName $params.rgname - ServerName $params.serverName - DatabaseName $params.databaseName - EmailAdmins $false - NotificationRecipientsEmails " " }
186
186
}
187
187
finally
188
188
{
0 commit comments