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 class
Indicate 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 TypeMethodDescriptionvoid
close()
Stop the container.boolean
closed()
Indicate if the container is closed.boolean
Indicate if the container initializion failed.boolean
isSupported
(Class<?> type) Test if the given type is supported for injection.<T> T
resolveInstance
(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:
true
if closed,false
otherwise
-
initFailed
public boolean initFailed()Indicate if the container initializion failed.- Returns:
true
if failed,false
otherwise
-
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:
true
if supported,false
otherwise- Throws:
HelidonTestContainer.InitializationFailed
- if the container previusly failed to start
-
toString
-