-
Notifications
You must be signed in to change notification settings - Fork 548
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7f71cc3
commit 117e1a3
Showing
2 changed files
with
90 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright (c) HashiCorp, Inc. | ||
// SPDX-License-Identifier: MPL-2.0 | ||
|
||
package provider | ||
|
||
import ( | ||
"reflect" | ||
"testing" | ||
|
||
"github.com/hashicorp/terraform-provider-vault/internal/consts" | ||
) | ||
|
||
func TestSecretsAuthDisableRemountUpgradeV0(t *testing.T) { | ||
tests := []struct { | ||
name string | ||
rawState map[string]interface{} | ||
want map[string]interface{} | ||
wantErr bool | ||
}{ | ||
{ | ||
name: "basic", | ||
rawState: map[string]interface{}{ | ||
consts.FieldDisableRemount: nil, | ||
}, | ||
want: map[string]interface{}{ | ||
consts.FieldDisableRemount: false, | ||
}, | ||
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
got, err := secretsAuthMountDisableRemountUpgradeV0(nil, tt.rawState, nil) | ||
|
||
if tt.wantErr { | ||
if err == nil { | ||
t.Fatalf("SecretsAuthMountDisableRemountUpgradeV0() error = %#v, wantErr %#v", err, tt.wantErr) | ||
} | ||
} | ||
|
||
if !reflect.DeepEqual(got, tt.want) { | ||
t.Errorf("SecretsAuthMountDisableRemountUpgradeV0() got = %#v, want %#v", got, tt.want) | ||
} | ||
}) | ||
} | ||
} |