Skip to content

Commit 07ccbf6

Browse files
committed
minor fix
1 parent ddbdf59 commit 07ccbf6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

internal/integration/client_side_encryption_prose_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,6 +1385,9 @@ func TestClientSideEncryptionProse(t *testing.T) {
13851385
// running. See specification for port numbers and necessary arguments:
13861386
// https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/tests/README.md#10-kms-tls-tests
13871387
mt.RunOpts("10. kms tls tests", noClientOpts, func(mt *mtest.T) {
1388+
if os.Getenv("KMS_MOCK_SERVERS_RUNNING") == "" {
1389+
mt.Skipf("Skipping test as KMS_MOCK_SERVERS_RUNNING is not set")
1390+
}
13881391
testcases := []struct {
13891392
name string
13901393
port int
@@ -1407,7 +1410,7 @@ func TestClientSideEncryptionProse(t *testing.T) {
14071410
ceo := options.ClientEncryption().
14081411
SetKmsProviders(fullKmsProvidersMap).
14091412
SetKeyVaultNamespace(kvNamespace)
1410-
cpt := setup(mt, nil, nil, ceo)
1413+
cpt := setup(mt, nil, defaultKvClientOptions, ceo)
14111414
defer cpt.teardown(mt)
14121415

14131416
_, err := cpt.clientEnc.CreateDataKey(context.Background(), "aws", options.DataKey().SetMasterKey(
@@ -1417,9 +1420,7 @@ func TestClientSideEncryptionProse(t *testing.T) {
14171420
{"endpoint", fmt.Sprintf("127.0.0.1:%d", tc.port)},
14181421
},
14191422
))
1420-
assert.NotNil(mt, err, "expected CreateDataKey error, got nil")
1421-
assert.True(mt, strings.Contains(err.Error(), tc.errMessage),
1422-
"expected CreateDataKey error to contain %v, got %v", tc.errMessage, err.Error())
1423+
assert.ErrorContains(mt, err, tc.errMessage)
14231424
})
14241425
}
14251426
})

0 commit comments

Comments
 (0)