优化结构
This commit is contained in:
@@ -46,6 +46,17 @@ func TestConnectivityTesterRestoreMaskedSecrets(t *testing.T) {
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("keeps an empty optional secret", func(t *testing.T) {
|
||||
values := map[string]any{"password": ""}
|
||||
|
||||
if err := tester.restoreMaskedSecrets("mq", "kafka", values); err != nil {
|
||||
t.Fatalf("restoreMaskedSecrets() error = %v", err)
|
||||
}
|
||||
if got := values["password"]; got != "" {
|
||||
t.Fatalf("password = %q, want empty value", got)
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("does not treat non-secret fields as masked secrets", func(t *testing.T) {
|
||||
values := map[string]any{
|
||||
"username": "******",
|
||||
|
||||
Reference in New Issue
Block a user