From 04656aebc0505d854e9442606b359d50e643e660 Mon Sep 17 00:00:00 2001 From: Gerard Snaauw Date: Fri, 1 Nov 2024 13:56:55 +0100 Subject: [PATCH] fix test --- pki/validator_test.go | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/pki/validator_test.go b/pki/validator_test.go index a92342d12..751089a30 100644 --- a/pki/validator_test.go +++ b/pki/validator_test.go @@ -215,20 +215,12 @@ func TestValidator_AddTruststore(t *testing.T) { t.Run("missing CA", func(t *testing.T) { noRootStore := store.Certificates()[:2] - t.Run("softfail", func(t *testing.T) { - val, err := newValidator(Config{Softfail: true}) - require.NoError(t, err) - - assert.NoError(t, val.AddTruststore(noRootStore)) - }) - t.Run("hardfail", func(t *testing.T) { - val, err := newValidator(Config{Softfail: false}) - require.NoError(t, err) + val, err := newValidator(Config{Softfail: true}) + require.NoError(t, err) - err = val.AddTruststore(noRootStore) + err = val.AddTruststore(noRootStore) - assert.ErrorContains(t, err, "certificate's issuer is not in the trust store") - }) + assert.ErrorContains(t, err, "certificate's issuer is not in the trust store") }) }