Skip to content

Commit e34247b

Browse files
committed
Add more tests to OpenTelemetryResourceAttributesTests
Signed-off-by: Dmytro Nosan <[email protected]>
1 parent faef7d5 commit e34247b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/opentelemetry/OpenTelemetryResourceAttributesTests.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,16 @@ void otelResourceAttributeValuesShouldBePercentDecoded() {
117117
.containsEntry("key", value);
118118
}
119119

120+
@Test
121+
void otelResourceAttributeValuesShouldBePercentDecodedWhenStringContainsNonAscii() {
122+
this.environmentVariables.put("OTEL_RESOURCE_ATTRIBUTES",
123+
"key=T%C5%8Dky%C5%8D,key1=%20\u015bp\u0159\u00ec\u0144\u0121%20");
124+
assertThat(getAttributes()).hasSize(3)
125+
.containsEntry("service.name", "unknown_service")
126+
.containsEntry("key", "Tōkyō")
127+
.containsEntry("key1", " śpřìńġ ");
128+
}
129+
120130
@Test
121131
void illegalArgumentExceptionShouldBeThrownWhenDecodingIllegalHexCharPercentEncodedValue() {
122132
this.environmentVariables.put("OTEL_RESOURCE_ATTRIBUTES", "key=abc%ß");

0 commit comments

Comments
 (0)