Skip to content

Commit

Permalink
fix quality violations
Browse files Browse the repository at this point in the history
  • Loading branch information
uchitsa committed Dec 28, 2024
1 parent 114a009 commit 58a5c15
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/test/java/com/jcabi/log/MulticolorLayoutTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ void transformsLoggingEventToText() {
Mockito.doReturn(Level.DEBUG).when(event).getLevel();
Mockito.doReturn("hello").when(event).getRenderedMessage();
MatcherAssert.assertThat(
"should equal to '[\\u001B[2;37mDEBUG\\u001B[m] \\u001B[2;37mhello\\u001B[m'",
StringEscapeUtils.escapeJava(layout.format(event)),
Matchers.equalTo(
"[\\u001B[2;37mDEBUG\\u001B[m] \\u001B[2;37mhello\\u001B[m"
Expand All @@ -74,6 +75,7 @@ void overwriteDefaultColor() {
Mockito.doReturn(Level.INFO).when(event).getLevel();
Mockito.doReturn("change").when(event).getRenderedMessage();
MatcherAssert.assertThat(
"should equal to '[\\u001B[2;10mINFO\\u001B[m] \\u001B[2;10mchange\\u001B[m'",
StringEscapeUtils.escapeJava(layout.format(event)),
Matchers.equalTo(
"[\\u001B[2;10mINFO\\u001B[m] \\u001B[2;10mchange\\u001B[m"
Expand All @@ -89,6 +91,7 @@ void rendersCustomConstantColor() {
Mockito.doReturn(Level.DEBUG).when(event).getLevel();
Mockito.doReturn("foo").when(event).getRenderedMessage();
MatcherAssert.assertThat(
"should equal to '\\u001B[31mDEBUG\\u001B[m foo'",
StringEscapeUtils.escapeJava(layout.format(event)),
Matchers.equalTo("\\u001B[31mDEBUG\\u001B[m foo")
);
Expand All @@ -103,6 +106,7 @@ void overwriteCustomConstantColor() {
Mockito.doReturn(Level.DEBUG).when(event).getLevel();
Mockito.doReturn("const").when(event).getRenderedMessage();
MatcherAssert.assertThat(
"should equal to '\\u001B[10mDEBUG\\u001B[m const'",
StringEscapeUtils.escapeJava(layout.format(event)),
Matchers.equalTo("\\u001B[10mDEBUG\\u001B[m const")
);
Expand All @@ -116,6 +120,7 @@ void rendersAnsiConstantColor() {
Mockito.doReturn(Level.DEBUG).when(event).getLevel();
Mockito.doReturn("bar").when(event).getRenderedMessage();
MatcherAssert.assertThat(
"should equal to '\\u001B[0;0;31mDEBUG\\u001B[m bar'",
StringEscapeUtils.escapeJava(layout.format(event)),
Matchers.equalTo("\\u001B[0;0;31mDEBUG\\u001B[m bar")
);
Expand Down

0 comments on commit 58a5c15

Please sign in to comment.