Skip to content

Instantly share code, notes, and snippets.

@markusdybeck
Created May 12, 2020 11:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markusdybeck/8d6ee053feed95b2e6941e0b4db6a612 to your computer and use it in GitHub Desktop.
Save markusdybeck/8d6ee053feed95b2e6941e0b4db6a612 to your computer and use it in GitHub Desktop.
Medium snippet 1
public class TestExtension implements BeforeAllCallback {
private static final ExtensionContext.Namespace NAMESPACE = ExtensionContext.Namespace.create("TestExtension");
private static final String TEST_CONTEXT_PLACEHOLDER = "testContext";
@Override
public void beforeAll(final ExtensionContext extensionContext) throws Exception {
if (TestExtensionInitializer.INSTANCE.initialize()) {
var testContext = TestContext.init();
extensionContext.getRoot()
.getStore(NAMESPACE)
.put(TEST_CONTEXT_PLACEHOLDER, testContext);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment