Package org.testng

Interface IInjectorFactory


  • public interface IInjectorFactory
    Allows customization of the Injector creation when working with dependency injection.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods 
      Modifier and Type Method Description
      default com.google.inject.Injector getInjector​(com.google.inject.Injector parent, com.google.inject.Stage stage, com.google.inject.Module... modules)
      Adding this method breaks existing implementations therefore for the time being (until deprecated method is removed) it calls the existing method.
      com.google.inject.Injector getInjector​(com.google.inject.Stage stage, com.google.inject.Module... modules)
      Deprecated.
      - As of TestNG 7.5.0
    • Method Detail

      • getInjector

        @Deprecated
        com.google.inject.Injector getInjector​(com.google.inject.Stage stage,
                                               com.google.inject.Module... modules)
        Deprecated.
        - As of TestNG 7.5.0
        Note that getInjector(Injector, Stage, Module...) should be used instead.
        Parameters:
        stage - - A Stage object that defines the appropriate stage
        modules - - An array of Module
        Returns:
        - An Injector instance that can be used to perform dependency injection.
      • getInjector

        default com.google.inject.Injector getInjector​(@Nullable
                                                       com.google.inject.Injector parent,
                                                       com.google.inject.Stage stage,
                                                       com.google.inject.Module... modules)
        Adding this method breaks existing implementations therefore for the time being (until deprecated method is removed) it calls the existing method.
        Parameters:
        parent - - Parent Injector instance that was built with parent injector
        stage - - A Stage object that defines the appropriate stage
        modules - - An array of Module
        Returns:
        - An Injector instance that can be used to perform dependency injection.