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 Details

    • ModelControllerClientProducer

      public ModelControllerClientProducer()
  • Method Details

    • canInject

      public boolean canInject(ExtensionContext context, Class<?> clazz, Annotation... annotations)
      Description copied from interface: ServerResourceProducer
      Indicates the type can be produced from this producer.
      Specified by:
      canInject in interface ServerResourceProducer
      Parameters:
      context - the current extension context
      clazz - the type to check
      annotations - the annotations, if any, for the field or parameter
      Returns:
      true if this producer can create this type, otherwise false
    • produce

      public Object produce(ExtensionContext context, Class<?> clazz, Annotation... annotations) throws IllegalArgumentException
      Description copied from interface: ServerResourceProducer
      Creates the object which can be injected into a static field, an instance field or a parameter.
      Specified by:
      produce in interface ServerResourceProducer
      Parameters:
      context - the current extension context
      clazz - the type of the field or parameter
      annotations - the annotations, if any, for the field or parameter
      Returns:
      the newly constructed object or null if it could not be produced
      Throws:
      IllegalArgumentException - if the type cannot be assigned to the type this producer can produce