Skip to content

Commit 85c1658

Browse files
author
chanhyun.kim2
committed
test: add a test that assert on the result from malformed data in BaggageCodecTest
1 parent a446cb0 commit 85c1658

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

api/all/src/test/java/io/opentelemetry/api/baggage/propagation/BaggageCodecTest.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
package io.opentelemetry.api.baggage.propagation;
77

88
import static org.assertj.core.api.Assertions.assertThat;
9-
import static org.assertj.core.api.Assertions.assertThatNoException;
109

1110
import java.nio.charset.StandardCharsets;
1211
import org.junit.jupiter.api.Test;
@@ -35,7 +34,7 @@ void shouldDecodePercentEncodedValues(String percentEncoded, String expectedDeco
3534
}
3635

3736
@Test
38-
void shouldThrowIfMalformedData() {
39-
assertThatNoException().isThrownBy(() -> BaggageCodec.decode("%1", StandardCharsets.UTF_8));
37+
void shouldIgnoreIfMalformedData() {
38+
assertThat(BaggageCodec.decode("%1", StandardCharsets.UTF_8)).isEqualTo("");
4039
}
4140
}

0 commit comments

Comments
 (0)