Class InjectionTestingSupport

java.lang.Object
io.helidon.inject.testing.InjectionTestingSupport

public class InjectionTestingSupport extends Object
Supporting helper utilities unit-testing Injection Services.
  • Method Details

    • resetAll

      public static void resetAll()
      Resets all internal configuration instances, JVM global singletons, service registries, etc.
    • bind

      public static void bind(InjectionServices injectionServices, ServiceProvider<?> serviceProvider)
      Provides a means to bind a service provider into the Services registry.
      Parameters:
      injectionServices - the services instance to bind into
      serviceProvider - the service provider to bind
      See Also:
    • testableServices

      public static InjectionServices testableServices()
      Creates a InjectionServices interface more conducive to unit and integration testing.
      Returns:
      testable services instance
    • testableServices

      public static InjectionServices testableServices(Config config)
      Creates a InjectionServices interface more conducive to unit and integration testing.
      Parameters:
      config - the config to use
      Returns:
      testable services instance
      See Also:
      • InjectionServicesConfig
    • basicTestableConfig

      public static Config basicTestableConfig()
      Basic testable configuration.
      Returns:
      testable config
    • toDescription

      public static String toDescription(Object providerOrInstance)
      Describe the provided instance or provider.
      Parameters:
      providerOrInstance - the instance to provider
      Returns:
      the description of the instance
    • toDescriptions

      public static List<String> toDescriptions(Collection<?> coll)
      Describe the provided instance or provider collection.
      Parameters:
      coll - the instance to provider collection
      Returns:
      the description of the instance