Class ModelControllerClientProducer
java.lang.Object
org.wildfly.testing.junit.extension.ModelControllerClientProducer
- All Implemented Interfaces:
ServerResourceProducer
@MetaInfServices
public class ModelControllerClientProducer
extends Object
implements ServerResourceProducer
Produces
ModelControllerClient instances for injection into test fields and parameters.- Author:
- James R. Perkins
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanInject(ExtensionContext context, Class<?> clazz, Annotation... annotations) Indicates the type can be produced from this producer.produce(ExtensionContext context, Class<?> clazz, Annotation... annotations) Creates the object which can be injected into a static field, an instance field or a parameter.
-
Constructor Details
-
ModelControllerClientProducer
public ModelControllerClientProducer()
-
-
Method Details
-
canInject
Description copied from interface:ServerResourceProducerIndicates the type can be produced from this producer.- Specified by:
canInjectin interfaceServerResourceProducer- Parameters:
context- the current extension contextclazz- the type to checkannotations- the annotations, if any, for the field or parameter- Returns:
trueif this producer can create this type, otherwisefalse
-
produce
public Object produce(ExtensionContext context, Class<?> clazz, Annotation... annotations) throws IllegalArgumentException Description copied from interface:ServerResourceProducerCreates the object which can be injected into a static field, an instance field or a parameter.- Specified by:
producein interfaceServerResourceProducer- Parameters:
context- the current extension contextclazz- the type of the field or parameterannotations- the annotations, if any, for the field or parameter- Returns:
- the newly constructed object or
nullif it could not be produced - Throws:
IllegalArgumentException- if the type cannot be assigned to the type this producer can produce
-