Class ClusterInstanceParameterResolver
java.lang.Object
org.apache.kafka.common.test.junit.ClusterInstanceParameterResolver
- All Implemented Interfaces:
org.junit.jupiter.api.extension.Extension,org.junit.jupiter.api.extension.ParameterResolver,org.junit.jupiter.api.extension.TestInstantiationAwareExtension
public class ClusterInstanceParameterResolver
extends Object
implements org.junit.jupiter.api.extension.ParameterResolver
This resolver provides an instance of
ClusterInstance to a test invocation. The instance represents the
underlying cluster being run for the current test. It can be injected into test methods or into the class
constructor.
N.B., if injected into the class constructor, the instance will not be fully initialized until the actual test method
is being invoked. This is because the cluster is not started until after class construction and after "before"
lifecycle methods have been run. Constructor injection is meant for convenience so helper methods can be defined on
the test which can rely on a class member rather than an argument for ClusterInstance.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.junit.jupiter.api.extension.TestInstantiationAwareExtension
org.junit.jupiter.api.extension.TestInstantiationAwareExtension.ExtensionContextScope -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionresolveParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) booleansupportsParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.junit.jupiter.api.extension.TestInstantiationAwareExtension
getTestInstantiationExtensionContextScope
-
Constructor Details
-
ClusterInstanceParameterResolver
-
-
Method Details
-
supportsParameter
public boolean supportsParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) - Specified by:
supportsParameterin interfaceorg.junit.jupiter.api.extension.ParameterResolver
-
resolveParameter
public Object resolveParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) - Specified by:
resolveParameterin interfaceorg.junit.jupiter.api.extension.ParameterResolver
-