public class DeleteEsDataExtension extends AbstractEsDataExtension implements org.junit.jupiter.api.extension.TestInstancePostProcessor, org.junit.jupiter.api.extension.BeforeAllCallback, org.junit.jupiter.api.extension.AfterAllCallback, org.junit.jupiter.api.extension.BeforeEachCallback
Extension
to delete data from Elasticsearch either before all tests, or before each test.loader, LOADER, TEST_INSTANCE
Constructor and Description |
---|
DeleteEsDataExtension() |
DeleteEsDataExtension(EsDataLoader loader)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
afterAll(org.junit.jupiter.api.extension.ExtensionContext context) |
void |
beforeAll(org.junit.jupiter.api.extension.ExtensionContext context) |
void |
beforeEach(org.junit.jupiter.api.extension.ExtensionContext context) |
protected org.junit.jupiter.api.extension.ExtensionContext.Namespace |
getNamespace() |
void |
postProcessTestInstance(java.lang.Object testInstance,
org.junit.jupiter.api.extension.ExtensionContext context)
Callback for post-processing the supplied test instance.
|
findMergedAnnotation, getApplicationContext, getDataLoader, getStore, getTestContextManager
public DeleteEsDataExtension()
public DeleteEsDataExtension(EsDataLoader loader)
loader
- the loaderpublic void beforeAll(org.junit.jupiter.api.extension.ExtensionContext context) throws java.lang.Exception
beforeAll
in interface org.junit.jupiter.api.extension.BeforeAllCallback
java.lang.Exception
public void afterAll(org.junit.jupiter.api.extension.ExtensionContext context) throws java.lang.Exception
afterAll
in interface org.junit.jupiter.api.extension.AfterAllCallback
java.lang.Exception
public void beforeEach(org.junit.jupiter.api.extension.ExtensionContext context) throws java.lang.Exception
beforeEach
in interface org.junit.jupiter.api.extension.BeforeEachCallback
java.lang.Exception
public void postProcessTestInstance(java.lang.Object testInstance, org.junit.jupiter.api.extension.ExtensionContext context)
Callback for post-processing the supplied test instance.
Note: the ExtensionContext
supplied to a
TestInstancePostProcessor
will always return an empty
Optional
value from getTestInstance()
. A TestInstancePostProcessor
should therefore only
attempt to process the supplied testInstance
.
postProcessTestInstance
in interface org.junit.jupiter.api.extension.TestInstancePostProcessor
testInstance
- the instance to post-process; never null
context
- the current extension context; never null
protected org.junit.jupiter.api.extension.ExtensionContext.Namespace getNamespace()
getNamespace
in class AbstractEsDataExtension