Fix ordering related issue in ReactorAutoConfigurationTests

See gh-34201
pull/37640/head
Moritz Halbritter 1 year ago
parent ec3c6ae382
commit fc9c1c0964

@ -20,8 +20,11 @@ import java.util.concurrent.atomic.AtomicReference;
import io.micrometer.context.ContextRegistry; import io.micrometer.context.ContextRegistry;
import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import reactor.core.publisher.Hooks;
import reactor.core.publisher.Mono; import reactor.core.publisher.Mono;
import reactor.util.context.Context; import reactor.util.context.Context;
@ -45,6 +48,12 @@ class ReactorAutoConfigurationTests {
private static final ThreadLocal<String> THREADLOCAL_VALUE = ThreadLocal.withInitial(() -> "initial"); private static final ThreadLocal<String> THREADLOCAL_VALUE = ThreadLocal.withInitial(() -> "initial");
@BeforeEach
@AfterEach
void resetStaticState() {
Hooks.disableAutomaticContextPropagation();
}
@BeforeAll @BeforeAll
static void initializeThreadLocalAccessors() { static void initializeThreadLocalAccessors() {
ContextRegistry globalRegistry = ContextRegistry.getInstance(); ContextRegistry globalRegistry = ContextRegistry.getInstance();

Loading…
Cancel
Save