squakez commented on code in PR #4844:
URL: https://github.com/apache/camel-k/pull/4844#discussion_r1368470117


##########
pkg/trait/logging_test.go:
##########
@@ -212,3 +213,31 @@ func TestJsonLoggingTrait(t *testing.T) {
        assert.True(t, logFormatIsNotDefault)
        assert.NotEmpty(t, env.ExecutedTraits)
 }
+
+func TestLoggingCategory(t *testing.T) {
+       env := createLoggingTestEnv(t, true, true, false, "TRACE", 
"%d{HH:mm:ss} %-5p (%t) %s%e%n", map[string]string{})
+       env.Integration.Spec.Traits = v1.Traits{
+               Logging: &traitv1.LoggingTrait{
+                       Category: map[string]string{"org.test": "debug"},
+               },
+       }
+
+       envVarQuarkusLogCategoryTestPackageName := 
"QUARKUS_LOG_CATEGORY_ORG_TEST_LEVEL"
+       envVarQuarkusLogCategoryTestPackageValue := "DEBUG"
+       quarkusOrgPackage := false
+
+       err := NewLoggingTestCatalog().apply(env)
+
+       assert.Nil(t, err)
+
+       for _, e := range env.EnvVars {
+               t.Log("Key:" + e.Name)
+               if e.Name == envVarQuarkusLogCategoryTestPackageName {
+                       t.Log("Value: " + e.Value)
+                       if e.Value == envVarQuarkusLogCategoryTestPackageValue {
+                               quarkusOrgPackage = true
+                       }
+               }
+       }
+       assert.True(t, quarkusOrgPackage)

Review Comment:
   Although this is correct, you better make use of `assert.Contains(t, array, 
val)`. You probably need to create an expected `corev1.EnvVar` with the 
key/value.



-- 
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]

Reply via email to