C
- The extension contextpublic abstract class AbstractMicronautExtension<C> extends java.lang.Object implements TestTransactionInterceptor
Modifier and Type | Field and Description |
---|---|
protected io.micronaut.context.ApplicationContext |
applicationContext |
static java.lang.String |
DISABLED_MESSAGE |
protected io.micronaut.runtime.EmbeddedApplication |
embeddedApplication |
static java.lang.String |
MISCONFIGURED_MESSAGE |
protected java.util.Map<java.lang.String,java.lang.Object> |
oldValues |
protected io.micronaut.runtime.context.scope.refresh.RefreshScope |
refreshScope |
protected io.micronaut.inject.BeanDefinition<?> |
specDefinition |
protected java.util.Map<java.lang.String,java.lang.Object> |
testProperties |
Constructor and Description |
---|
AbstractMicronautExtension() |
Modifier and Type | Method and Description |
---|---|
protected void |
afterClass(C context)
Executed after the class is complete.
|
void |
afterEach(C context)
Executed after each test completes.
|
protected abstract void |
alignMocks(C context,
java.lang.Object instance) |
protected void |
beforeClass(C context,
java.lang.Class<?> testClass,
MicronautTest testAnnotation)
Executed before tests within a class are run.
|
protected void |
beforeEach(C context,
java.lang.Object testInstance,
java.lang.reflect.AnnotatedElement method) |
void |
begin()
Begin the transaction.
|
void |
commit()
Commit the transaction.
|
protected boolean |
isTestSuiteBeanPresent(java.lang.Class<?> requiredTestClass) |
void |
rollback()
Rollback the transaction.
|
protected void |
startApplicationContext() |
public static final java.lang.String DISABLED_MESSAGE
public static final java.lang.String MISCONFIGURED_MESSAGE
protected io.micronaut.context.ApplicationContext applicationContext
protected io.micronaut.runtime.EmbeddedApplication embeddedApplication
protected io.micronaut.runtime.context.scope.refresh.RefreshScope refreshScope
protected io.micronaut.inject.BeanDefinition<?> specDefinition
protected java.util.Map<java.lang.String,java.lang.Object> testProperties
protected java.util.Map<java.lang.String,java.lang.Object> oldValues
public void begin()
TestTransactionInterceptor
begin
in interface TestTransactionInterceptor
public void commit()
TestTransactionInterceptor
commit
in interface TestTransactionInterceptor
public void rollback()
TestTransactionInterceptor
rollback
in interface TestTransactionInterceptor
protected void beforeClass(C context, java.lang.Class<?> testClass, @Nullable MicronautTest testAnnotation)
context
- The test contexttestClass
- The test classtestAnnotation
- The test annotationprotected void beforeEach(C context, @Nullable java.lang.Object testInstance, @Nullable java.lang.reflect.AnnotatedElement method)
protected void afterClass(C context)
context
- the contextpublic void afterEach(C context)
context
- The contextprotected void startApplicationContext()
protected boolean isTestSuiteBeanPresent(java.lang.Class<?> requiredTestClass)
protected abstract void alignMocks(C context, java.lang.Object instance)