Skip to content

Commit bbf0c54

Browse files
committed
Fix SonarCube finding.
1 parent 0c37061 commit bbf0c54

File tree

1 file changed

+3
-4
lines changed
  • powertools-logging/powertools-logging-logback/src/test/java/software/amazon/lambda/powertools/logging/internal

1 file changed

+3
-4
lines changed

powertools-logging/powertools-logging-logback/src/test/java/software/amazon/lambda/powertools/logging/internal/LambdaJsonEncoderTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
@Order(2)
6767
class LambdaJsonEncoderTest {
6868
private static final Logger logger = (Logger) LoggerFactory.getLogger(LambdaJsonEncoderTest.class.getName());
69+
private final LoggingEvent loggingEvent = new LoggingEvent("fqcn", logger, Level.INFO, "message", null, null);
6970

7071
private Context context;
7172

@@ -167,8 +168,6 @@ void shouldLogArgumentsAsJsonWhenUsingKeyValue() {
167168
});
168169
}
169170

170-
private final LoggingEvent loggingEvent = new LoggingEvent("fqcn", logger, Level.INFO, "message", null, null);
171-
172171
@Test
173172
void shouldNotLogPowertoolsInfo() {
174173
// GIVEN
@@ -218,9 +217,9 @@ void shouldLogStructuredArgumentsAsNewEntries() {
218217
StructuredArgument argument = StructuredArguments.entry("msg", msg);
219218

220219
// WHEN
221-
LoggingEvent loggingEvent = new LoggingEvent("fqcn", logger, Level.INFO, "A message", null,
220+
LoggingEvent structuredLoggingEvent = new LoggingEvent("fqcn", logger, Level.INFO, "A message", null,
222221
new Object[] { argument });
223-
byte[] encoded = encoder.encode(loggingEvent);
222+
byte[] encoded = encoder.encode(structuredLoggingEvent);
224223
String result = new String(encoded, StandardCharsets.UTF_8);
225224

226225
// THEN (logged as JSON)

0 commit comments

Comments
 (0)