forked from inspectIT/inspectit-ocelot
-
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.
Closes inspectIT#391 handle invalid metric tags
util method in CommonTagsManager to create TagValue for all invalid TagValues is <invalid> generated
- Loading branch information
Showing
10 changed files
with
97 additions
and
28 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
27 changes: 27 additions & 0 deletions
27
...tit-ocelot-core/src/test/java/rocks/inspectit/ocelot/core/tags/CommonTagsManagerTest.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,27 @@ | ||
package rocks.inspectit.ocelot.core.tags; | ||
|
||
import io.opencensus.tags.TagValue; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
public class CommonTagsManagerTest { | ||
|
||
@Test | ||
public void createTagValue() { | ||
assertThat(CommonTagsManager.createTagValue("my-tag-value")).isEqualTo(TagValue.create("my-tag-value")); | ||
} | ||
|
||
@Test | ||
public void createTagValue_tooLong() { | ||
assertThat(CommonTagsManager.createTagValue("this-value-is-over-255-characters-long ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------")) | ||
.isEqualTo(TagValue.create("<invalid>")); | ||
} | ||
|
||
@Test | ||
public void createTagValue_nonPrintableCharacter() { | ||
assertThat(CommonTagsManager.createTagValue("non-printable-character-\u007f")) | ||
.isEqualTo(TagValue.create("<invalid>")); | ||
} | ||
|
||
} |