Package io.helidon.microprofile.testing
Class HelidonTestContainer
java.lang.Object
io.helidon.microprofile.testing.HelidonTestContainer
CDI container testing facade.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classIndicate that the container previously failed to initialize. -
Constructor Summary
ConstructorsConstructorDescriptionHelidonTestContainer(HelidonTestInfo<?> testInfo, HelidonTestScope testScope, BiFunction<HelidonTestInfo<?>, HelidonTestScope, HelidonTestExtension> extensionFactory) Create a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Stop the container.booleanclosed()Indicate if the container is closed.booleanIndicate if the container initializion failed.booleanisSupported(Class<?> type) Test if the given type is supported for injection.<T> TresolveInstance(Class<T> type) Resolve an unqualified bean of the given type.toString()
-
Constructor Details
-
HelidonTestContainer
public HelidonTestContainer(HelidonTestInfo<?> testInfo, HelidonTestScope testScope, BiFunction<HelidonTestInfo<?>, HelidonTestScope, HelidonTestExtension> extensionFactory) Create a new instance.- Parameters:
testInfo- test infotestScope- test scopeextensionFactory- extension factory
-
-
Method Details
-
close
public void close()Stop the container. -
closed
public boolean closed()Indicate if the container is closed.- Returns:
trueif closed,falseotherwise
-
initFailed
public boolean initFailed()Indicate if the container initializion failed.- Returns:
trueif failed,falseotherwise
-
resolveInstance
Resolve an unqualified bean of the given type.- Type Parameters:
T- type- Parameters:
type- type- Returns:
- resolved instance
- Throws:
HelidonTestContainer.InitializationFailed- if the container previusly failed to start
-
isSupported
Test if the given type is supported for injection.- Parameters:
type- type- Returns:
trueif supported,falseotherwise- Throws:
HelidonTestContainer.InitializationFailed- if the container previusly failed to start
-
toString
-