-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#21 formatting, usersConfig unitTest update (email is now optional)
- Loading branch information
Showing
2 changed files
with
10 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ class UsersConfigTest extends AnyFlatSpec with Matchers { | |
userCfg.validate() | ||
} | ||
|
||
it should "fail on missing user/pwd/mail/groups" in { | ||
it should "fail on missing user/pwd/groups" in { | ||
intercept[ConfigValidationException] { | ||
userCfg.copy(username = null).validate() | ||
}.msg should include("username is empty") | ||
|
@@ -36,19 +36,19 @@ class UsersConfigTest extends AnyFlatSpec with Matchers { | |
userCfg.copy(password = null).validate() | ||
}.msg should include("password is empty") | ||
|
||
intercept[ConfigValidationException] { | ||
userCfg.copy(email = null).validate() | ||
}.msg should include("email is empty") | ||
|
||
intercept[ConfigValidationException] { | ||
userCfg.copy(groups = null).validate() | ||
}.msg should include("groups are missing") | ||
} | ||
|
||
it should "validate ok empty groups" in { | ||
it should "succeed empty groups" in { | ||
userCfg.copy(groups = Array.empty).validate() | ||
} | ||
|
||
it should "succeed missing email (it is optional)" in { | ||
userCfg.copy(email = null).validate() | ||
} | ||
|
||
val usersCfg = UsersConfig(knownUsers = Array(userCfg)) | ||
"UsersConfig" should "validate ok expected filled content" in { | ||
usersCfg.validate() | ||
|
@@ -72,7 +72,7 @@ class UsersConfigTest extends AnyFlatSpec with Matchers { | |
UserConfig("sameUser", "password2", "[email protected]", Array()), | ||
|
||
UserConfig("sameUser2", "passwordX", "abc@def", Array()), | ||
UserConfig("sameUser2", "passwordA", "jkl@mno", Array()), | ||
UserConfig("sameUser2", "passwordA", null, Array()), | ||
|
||
UserConfig("okUser", "passwordO", "ooo@", Array()) | ||
)).validate() | ||
|