diff --git a/test/envtest/kongconsumercredential_acl_test.go b/test/envtest/kongconsumercredential_acl_test.go index 8a5b5474e..90fe95f5a 100644 --- a/test/envtest/kongconsumercredential_acl_test.go +++ b/test/envtest/kongconsumercredential_acl_test.go @@ -116,6 +116,18 @@ func TestKongConsumerCredential_ACL(t *testing.T) { StartReconcilers(ctx, t, mgr, logs, reconcilers...) + assert.EventuallyWithT(t, + func(c *assert.CollectT) { + if !assert.NoError(c, + clientNamespaced.Get(ctx, client.ObjectKeyFromObject(kongCredentialACL), kongCredentialACL), + ) { + return + } + assert.Equal(t, aclID, kongCredentialACL.Status.Konnect.ID) + }, waitTime, tickTime, + "KongCredentialACL wasn't created", + ) + assert.EventuallyWithT(t, func(c *assert.CollectT) { assert.True(c, factory.SDK.KongCredentialsACLSDK.AssertExpectations(t)) }, waitTime, tickTime) diff --git a/test/envtest/kongconsumercredential_apikey_test.go b/test/envtest/kongconsumercredential_apikey_test.go index d442147ed..32ff10efc 100644 --- a/test/envtest/kongconsumercredential_apikey_test.go +++ b/test/envtest/kongconsumercredential_apikey_test.go @@ -115,6 +115,18 @@ func TestKongConsumerCredential_APIKey(t *testing.T) { StartReconcilers(ctx, t, mgr, logs, reconcilers...) + assert.EventuallyWithT(t, + func(c *assert.CollectT) { + if !assert.NoError(c, + clientNamespaced.Get(ctx, client.ObjectKeyFromObject(kongCredentialAPIKey), kongCredentialAPIKey), + ) { + return + } + assert.Equal(t, keyID, kongCredentialAPIKey.Status.Konnect.ID) + }, waitTime, tickTime, + "KongCredentialAPIKey wasn't created", + ) + assert.EventuallyWithT(t, func(c *assert.CollectT) { assert.True(c, factory.SDK.KongCredentialsAPIKeySDK.AssertExpectations(t)) }, waitTime, tickTime) diff --git a/test/envtest/kongconsumercredential_basicauth_test.go b/test/envtest/kongconsumercredential_basicauth_test.go index 8ac53ae3c..182bc76bf 100644 --- a/test/envtest/kongconsumercredential_basicauth_test.go +++ b/test/envtest/kongconsumercredential_basicauth_test.go @@ -118,6 +118,18 @@ func TestKongConsumerCredential_BasicAuth(t *testing.T) { StartReconcilers(ctx, t, mgr, logs, reconcilers...) + assert.EventuallyWithT(t, + func(c *assert.CollectT) { + if !assert.NoError(c, + clientNamespaced.Get(ctx, client.ObjectKeyFromObject(kongCredentialBasicAuth), kongCredentialBasicAuth), + ) { + return + } + assert.Equal(t, basicAuthID, kongCredentialBasicAuth.Status.Konnect.ID) + }, waitTime, tickTime, + "KongCredentialBasicAuth wasn't created", + ) + assert.EventuallyWithT(t, func(c *assert.CollectT) { assert.True(c, factory.SDK.KongCredentialsBasicAuthSDK.AssertExpectations(t)) }, waitTime, tickTime) diff --git a/test/envtest/kongconsumercredential_hmac_test.go b/test/envtest/kongconsumercredential_hmac_test.go index b261922b9..df5058562 100644 --- a/test/envtest/kongconsumercredential_hmac_test.go +++ b/test/envtest/kongconsumercredential_hmac_test.go @@ -115,6 +115,18 @@ func TestKongConsumerCredential_HMAC(t *testing.T) { StartReconcilers(ctx, t, mgr, logs, reconcilers...) + assert.EventuallyWithT(t, + func(c *assert.CollectT) { + if !assert.NoError(c, + clientNamespaced.Get(ctx, client.ObjectKeyFromObject(kongCredentialHMAC), kongCredentialHMAC), + ) { + return + } + assert.Equal(t, hmacID, kongCredentialHMAC.Status.Konnect.ID) + }, waitTime, tickTime, + "KongCredentialHMAC wasn't created", + ) + assert.EventuallyWithT(t, func(c *assert.CollectT) { assert.True(c, factory.SDK.KongCredentialsHMACSDK.AssertExpectations(t)) }, waitTime, tickTime) diff --git a/test/envtest/kongconsumercredential_jwt_test.go b/test/envtest/kongconsumercredential_jwt_test.go index 752320df5..bf31b500e 100644 --- a/test/envtest/kongconsumercredential_jwt_test.go +++ b/test/envtest/kongconsumercredential_jwt_test.go @@ -116,6 +116,18 @@ func TestKongConsumerCredential_JWT(t *testing.T) { StartReconcilers(ctx, t, mgr, logs, reconcilers...) + assert.EventuallyWithT(t, + func(c *assert.CollectT) { + if !assert.NoError(c, + clientNamespaced.Get(ctx, client.ObjectKeyFromObject(kongCredentialJWT), kongCredentialJWT), + ) { + return + } + assert.Equal(t, jwtID, kongCredentialJWT.Status.Konnect.ID) + }, waitTime, tickTime, + "KongCredentialHMAC wasn't created", + ) + assert.EventuallyWithT(t, func(c *assert.CollectT) { assert.True(c, factory.SDK.KongCredentialsJWTSDK.AssertExpectations(t)) }, waitTime, tickTime)