squakez commented on code in PR #6667:
URL: https://github.com/apache/camel-k/pull/6667#discussion_r3385940422
##########
pkg/trait/service_test.go:
##########
@@ -633,7 +632,10 @@ func TestServiceAutoConfiguration(t *testing.T) {
}
_, traits, err := traitCatalog.apply(&environment)
require.NoError(t, err)
- assert.Equal(t, ptr.To(true), traits.Service.Enabled)
+ assert.NotNil(t, environment.GetTrait(serviceTraitID))
+ if traits.Service != nil {
Review Comment:
Instead of the `if` condition, we should assert the trait.Service is not nil
as well the trait is enabled. You can directly check `enabled` even if it is
private since you're testing it in the same package.
##########
pkg/trait/service_test.go:
##########
@@ -575,10 +575,9 @@ func
TestServiceWithKnativeServiceDisabledInIntegrationPlatform(t *testing.T) {
"KnativeServiceNotAvailable",
"explicitly disabled",
)
- conditions, traits, err := traitCatalog.apply(&environment)
+ conditions, _, err := traitCatalog.apply(&environment)
Review Comment:
Probably we must verify the `traits` is empty?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]