forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request quarkusio#36941 from brunobat/fix-resource-attributes
Fix OTel Resource Attributes
- Loading branch information
Showing
2 changed files
with
76 additions
and
34 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
...oyment/src/test/java/io/quarkus/opentelemetry/deployment/InvalidAttributesConfigTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package io.quarkus.opentelemetry.deployment; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import java.util.NoSuchElementException; | ||
import java.util.function.Consumer; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.test.QuarkusUnitTest; | ||
|
||
public class InvalidAttributesConfigTest { | ||
@RegisterExtension | ||
static final QuarkusUnitTest TEST = new QuarkusUnitTest() | ||
.overrideConfigKey("quarkus.otel.resource.attributes", "pod.id=${SOMETHING}") | ||
.assertException(new Consumer<Throwable>() { | ||
@Override | ||
public void accept(final Throwable throwable) { | ||
throwable.getCause().printStackTrace(); | ||
assertTrue(throwable.getCause() instanceof NoSuchElementException); | ||
assertEquals("SRCFG00011: Could not expand value SOMETHING in property quarkus.otel.resource.attributes", | ||
throwable.getCause().getMessage()); | ||
} | ||
}); | ||
|
||
@Test | ||
void test() { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters