diff --git a/pom.xml b/pom.xml
index b8829c0..26d6e4e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -226,6 +226,7 @@
3.8.0
+ ${java.version}
diff --git a/slf4j/src/test/java/io/redlink/utils/logging/LoggingContextTest.java b/slf4j/src/test/java/io/redlink/utils/logging/LoggingContextTest.java
index 20f90db..c6d7c61 100644
--- a/slf4j/src/test/java/io/redlink/utils/logging/LoggingContextTest.java
+++ b/slf4j/src/test/java/io/redlink/utils/logging/LoggingContextTest.java
@@ -151,23 +151,22 @@ void testWrapInCopyRunable() throws Throwable {
final String value2 = UUID.randomUUID().toString();
MDC.put("mdc", value);
- try (ExecutorService executor = Executors.newSingleThreadExecutor()) {
- try (LoggingContext ctx = LoggingContext.create()) {
- MDC.put("mdc", value2);
-
- final Future> future = executor.submit(
- ctx.wrapInCopy(() -> {
- assertThat(MDC.get("mdc"), CoreMatchers.is(value2));
- MDC.put("mdc", UUID.randomUUID().toString());
- }));
- assertThat(MDC.get("mdc"), CoreMatchers.is(value2));
- future.get();
- assertThat(MDC.get("mdc"), CoreMatchers.is(value2));
- } catch (ExecutionException e) {
- throw e.getCause();
- } finally {
- executor.shutdownNow();
- }
+ final ExecutorService executor = Executors.newSingleThreadExecutor();
+ try (LoggingContext ctx = LoggingContext.create()) {
+ MDC.put("mdc", value2);
+
+ final Future> future = executor.submit(
+ ctx.wrapInCopy(() -> {
+ assertThat(MDC.get("mdc"), CoreMatchers.is(value2));
+ MDC.put("mdc", UUID.randomUUID().toString());
+ }));
+ assertThat(MDC.get("mdc"), CoreMatchers.is(value2));
+ future.get();
+ assertThat(MDC.get("mdc"), CoreMatchers.is(value2));
+ } catch (ExecutionException e) {
+ throw e.getCause();
+ } finally {
+ executor.shutdownNow();
}
}
@@ -177,24 +176,23 @@ void testWrapInCopyCallable() throws Throwable {
final String value2 = UUID.randomUUID().toString();
MDC.put("mdc", value);
- try (ExecutorService executor = Executors.newSingleThreadExecutor()) {
- try (LoggingContext ctx = LoggingContext.create()) {
- MDC.put("mdc", value2);
-
- final Future> future = executor.submit(
- ctx.wrapInCopy((Callable) () -> {
- assertThat(MDC.get("mdc"), CoreMatchers.is(value2));
- MDC.put("mdc", UUID.randomUUID().toString());
- return "hello";
- }));
- assertThat(MDC.get("mdc"), CoreMatchers.is(value2));
- future.get();
- assertThat(MDC.get("mdc"), CoreMatchers.is(value2));
- } catch (ExecutionException e) {
- throw e.getCause();
- } finally {
- executor.shutdownNow();
- }
+ final ExecutorService executor = Executors.newSingleThreadExecutor();
+ try (LoggingContext ctx = LoggingContext.create()) {
+ MDC.put("mdc", value2);
+
+ final Future> future = executor.submit(
+ ctx.wrapInCopy((Callable) () -> {
+ assertThat(MDC.get("mdc"), CoreMatchers.is(value2));
+ MDC.put("mdc", UUID.randomUUID().toString());
+ return "hello";
+ }));
+ assertThat(MDC.get("mdc"), CoreMatchers.is(value2));
+ future.get();
+ assertThat(MDC.get("mdc"), CoreMatchers.is(value2));
+ } catch (ExecutionException e) {
+ throw e.getCause();
+ } finally {
+ executor.shutdownNow();
}
}