Interface ValueInjector


  • public interface ValueInjector
    Used to inject field values in tests that are annotated with @Inject.

    Note that implementations must have a public no-arg constructor.

    Author:
    James R. Perkins
    • Method Detail

      • canInject

        default boolean canInject​(Class<?> type)
        Determines if this injector can handle the fields type.
        Parameters:
        type - the fields type
        Returns:
        true if this injector can handle the field type, otherwise false
      • supportedType

        Class<?> supportedType()
        Returns the type this injector can inject.
        Returns:
        the type this injector can inject
      • resolve

        Object resolve​(org.junit.jupiter.api.extension.ExtensionContext context)
        Returns the value to be injected.
        Parameters:
        context - the extensions context
        Returns:
        the value to be injected