Skip to content

Commit

Permalink
Use new methods for all user models
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-asawicki committed Dec 20, 2024
1 parent fb8b9ad commit 6946308
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
12 changes: 6 additions & 6 deletions pkg/datasources/users_acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ func TestAcc_Users_PersonUser(t *testing.T) {
WithDefaultRole("some_role").
WithDefaultSecondaryRolesOptionEnum(sdk.SecondaryRolesOptionAll).
WithMinsToBypassMfa(10).
WithRsaPublicKeyValue(config.MultilineWrapperVariable(key1)).
WithRsaPublicKey2Value(config.MultilineWrapperVariable(key2)).
WithRsaPublicKey(key1).
WithRsaPublicKey2(key2).
WithComment(comment).
WithDisableMfa("true")

Expand Down Expand Up @@ -204,8 +204,8 @@ func TestAcc_Users_ServiceUser(t *testing.T) {
WithDefaultNamespace("some.namespace").
WithDefaultRole("some_role").
WithDefaultSecondaryRolesOptionEnum(sdk.SecondaryRolesOptionAll).
WithRsaPublicKeyValue(config.MultilineWrapperVariable(key1)).
WithRsaPublicKey2Value(config.MultilineWrapperVariable(key2)).
WithRsaPublicKey(key1).
WithRsaPublicKey2(key2).
WithComment(comment)

resource.Test(t, resource.TestCase{
Expand Down Expand Up @@ -364,8 +364,8 @@ func TestAcc_Users_LegacyServiceUser(t *testing.T) {
WithDefaultNamespace("some.namespace").
WithDefaultRole("some_role").
WithDefaultSecondaryRolesOptionEnum(sdk.SecondaryRolesOptionAll).
WithRsaPublicKeyValue(config.MultilineWrapperVariable(key1)).
WithRsaPublicKey2Value(config.MultilineWrapperVariable(key2)).
WithRsaPublicKey(key1).
WithRsaPublicKey2(key2).
WithComment(comment)

resource.Test(t, resource.TestCase{
Expand Down
8 changes: 4 additions & 4 deletions pkg/resources/legacy_service_user_acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ func TestAcc_LegacyServiceUser_BasicFlows(t *testing.T) {
WithDefaultNamespace("some.namespace").
WithDefaultRole("some_role").
WithDefaultSecondaryRolesOptionEnum(sdk.SecondaryRolesOptionAll).
WithRsaPublicKeyValue(config.MultilineWrapperVariable(key1)).
WithRsaPublicKey2Value(config.MultilineWrapperVariable(key2)).
WithRsaPublicKey(key1).
WithRsaPublicKey2(key2).
WithComment(comment)

userModelAllAttributesChanged := func(loginName string) *model.LegacyServiceUserModel {
Expand All @@ -74,8 +74,8 @@ func TestAcc_LegacyServiceUser_BasicFlows(t *testing.T) {
WithDefaultNamespace("one_part_namespace").
WithDefaultRole("other_role").
WithDefaultSecondaryRolesOptionEnum(sdk.SecondaryRolesOptionAll).
WithRsaPublicKeyValue(config.MultilineWrapperVariable(key2)).
WithRsaPublicKey2Value(config.MultilineWrapperVariable(key1)).
WithRsaPublicKey(key2).
WithRsaPublicKey2(key1).
WithComment(newComment)
}

Expand Down
8 changes: 4 additions & 4 deletions pkg/resources/service_user_acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ func TestAcc_ServiceUser_BasicFlows(t *testing.T) {
WithDefaultNamespace("some.namespace").
WithDefaultRole("some_role").
WithDefaultSecondaryRolesOptionEnum(sdk.SecondaryRolesOptionAll).
WithRsaPublicKeyValue(config.MultilineWrapperVariable(key1)).
WithRsaPublicKey2Value(config.MultilineWrapperVariable(key2)).
WithRsaPublicKey(key1).
WithRsaPublicKey2(key2).
WithComment(comment)

userModelAllAttributesChanged := func(loginName string) *model.ServiceUserModel {
Expand All @@ -67,8 +67,8 @@ func TestAcc_ServiceUser_BasicFlows(t *testing.T) {
WithDefaultNamespace("one_part_namespace").
WithDefaultRole("other_role").
WithDefaultSecondaryRolesOptionEnum(sdk.SecondaryRolesOptionAll).
WithRsaPublicKeyValue(config.MultilineWrapperVariable(key2)).
WithRsaPublicKey2Value(config.MultilineWrapperVariable(key1)).
WithRsaPublicKey(key2).
WithRsaPublicKey2(key1).
WithComment(newComment)
}

Expand Down
14 changes: 7 additions & 7 deletions pkg/resources/user_acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ func TestAcc_User_BasicFlows(t *testing.T) {
WithDefaultRole("some_role").
WithDefaultSecondaryRolesOptionEnum(sdk.SecondaryRolesOptionAll).
WithMinsToBypassMfa(10).
WithRsaPublicKeyValue(config.MultilineWrapperVariable(key1)).
WithRsaPublicKey2Value(config.MultilineWrapperVariable(key2)).
WithRsaPublicKey(key1).
WithRsaPublicKey2(key2).
WithComment(comment).
WithDisableMfa("true")

Expand All @@ -87,8 +87,8 @@ func TestAcc_User_BasicFlows(t *testing.T) {
WithDefaultRole("other_role").
WithDefaultSecondaryRolesOptionEnum(sdk.SecondaryRolesOptionAll).
WithMinsToBypassMfa(14).
WithRsaPublicKeyValue(config.MultilineWrapperVariable(key2)).
WithRsaPublicKey2Value(config.MultilineWrapperVariable(key1)).
WithRsaPublicKey(key2).
WithRsaPublicKey2(key1).
WithComment(newComment).
WithDisableMfa("false")
}
Expand Down Expand Up @@ -696,15 +696,15 @@ func TestAcc_User_issue2970(t *testing.T) {

userModel := model.User(resourceName, userId.Name()).
WithPassword(pass).
WithRsaPublicKeyValue(config.MultilineWrapperVariable(key))
WithRsaPublicKey(key)

newUserModelIncorrectNewKey := model.User(resourceName, userId.Name()).
WithPassword(newPass).
WithRsaPublicKeyValue(config.MultilineWrapperVariable(incorrectlyFormattedNewKey))
WithRsaPublicKey(incorrectlyFormattedNewKey)

newUserModel := model.User(resourceName, userId.Name()).
WithPassword(newPass).
WithRsaPublicKeyValue(config.MultilineWrapperVariable(newKey))
WithRsaPublicKey(newKey)

resource.Test(t, resource.TestCase{
ProtoV6ProviderFactories: acc.TestAccProtoV6ProviderFactories,
Expand Down

0 comments on commit 6946308

Please sign in to comment.