Package io.trino.tempto.context
Class ThreadLocalTestContextHolder
java.lang.Object
io.trino.tempto.context.ThreadLocalTestContextHolder
Static helper for holding TestContext stack in a thread local variable.
Justification for existence:
Using thread local for holding current TestContext is less explicit and a bit hacky. But allows for having less verbose test building blocks.
We also do not require users to subclass a common context-aware test class when they write tests.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic voidstatic TestContextStack<TestContext>static TestContextstatic voidpushAllTestContexts(TestContextStack<? extends TestContext> testContextStack) static voidpushTestContext(TestContext testContext) static TestContextstatic Optional<TestContext>
-
Method Details
-
testContext
-
testContextIfSet
-
pushTestContext
-
popTestContext
-
pushAllTestContexts
-
popAllTestContexts
-
assertTestContextNotSet
public static void assertTestContextNotSet() -
assertTestContextSet
public static void assertTestContextSet()
-