Skip to content

Commit c7fbbbc

Browse files
committed
Add service name env var for powertools-logging unit tests.
1 parent cd4e7a1 commit c7fbbbc

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

powertools-logging/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@
186186
<configuration>
187187
<environmentVariables>
188188
<AWS_LAMBDA_LOG_FORMAT>JSON</AWS_LAMBDA_LOG_FORMAT>
189+
<POWERTOOLS_SERVICE_NAME>testService</POWERTOOLS_SERVICE_NAME>
189190
</environmentVariables>
190191
</configuration>
191192
</plugin>

powertools-logging/src/test/java/software/amazon/lambda/powertools/logging/PowertoolsLoggingTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ void initializeLogging_withContextOnly_shouldSetLambdaFields() {
245245
.containsEntry(PowertoolsLoggedFields.FUNCTION_NAME.getName(), "test-function")
246246
.containsEntry(PowertoolsLoggedFields.FUNCTION_VERSION.getName(), "1")
247247
.containsEntry(PowertoolsLoggedFields.FUNCTION_COLD_START.getName(), "true")
248-
.containsEntry(PowertoolsLoggedFields.SERVICE.getName(), "service_undefined");
248+
.containsEntry(PowertoolsLoggedFields.SERVICE.getName(), "testService");
249249
}
250250

251251
@Test

0 commit comments

Comments
 (0)