fix: fix linting errors and test
Some checks failed
CI Workflow / Check GoReleaser config (pull_request) Successful in 10s
CI Workflow / Test readiness for publishing provider (pull_request) Failing after 30s
CI Workflow / CI run build and linting (pull_request) Failing after 10s
CI Workflow / Code coverage report (pull_request) Has been skipped
CI Workflow / CI run tests (pull_request) Failing after 10m19s

This commit is contained in:
Marcel S. Henselin 2026-03-02 09:14:13 +01:00
parent a63ae1831d
commit c15f21a16d
4 changed files with 23 additions and 10 deletions

View file

@ -80,20 +80,30 @@ func Test_handleEncryption(t *testing.T) {
},
},
},
want: sqlserverflexbetaRs.EncryptionValue{
KekKeyId: types.StringValue("kek_key_id"),
KekKeyRingId: types.StringValue("kek_key_ring_id"),
KekKeyVersion: types.StringValue("kek_key_version"),
ServiceAccount: types.StringValue("kek_svc_acc"),
},
want: sqlserverflexbetaRs.NewEncryptionValueMust(
sqlserverflexbetaRs.EncryptionValue{}.AttributeTypes(context.TODO()),
map[string]attr.Value{
"kek_key_id": types.StringValue("kek_key_id"),
"kek_key_ring_id": types.StringValue("kek_key_ring_id"),
"kek_key_version": types.StringValue("kek_key_version"),
"service_account": types.StringValue("kek_svc_acc"),
},
),
},
}
for _, tt := range tests {
t.Run(
tt.name, func(t *testing.T) {
if got := handleEncryption(t.Context(), tt.args.m, tt.args.resp); !reflect.DeepEqual(got, tt.want) {
t.Errorf("handleEncryption() = %v, want %v", got, tt.want)
got := handleEncryption(t.Context(), tt.args.m, tt.args.resp)
diff := cmp.Diff(tt.want, got)
if diff != "" {
t.Fatalf("Data does not match: %s", diff)
}
//if !reflect.DeepEqual(got, tt.want) {
// t.Errorf("handleEncryption() = %v, want %v", got, tt.want)
//}
},
)
}