Class TestBeanReplacements

java.lang.Object
com.ultikits.ultitools.context.TestBeanReplacements

@Internal final class TestBeanReplacements extends Object
A single module's replacement plan, created only by the in-process boot's scanner.
  • Field Details

    • container

      private final SimpleContainer container
      The fresh child container, never a server or parent container.
    • module

      private final String module
      Identifies the failing test module without consulting its assembled beans.
    • requests

      private final Map<Class<?>,Object> requests
      The test bootstrap's immutable per-module requests; Paper does not supply any.
    • definitions

      private final Set<TestBeanReplacements.Definition> definitions
      Definitions the test scan actually accepted; overlapping scans of one class count once.
    • replacedFactories

      private final Set<Method> replacedFactories
      Test factories whose singleton and aliases were already installed as stand-ins.
  • Constructor Details

    • TestBeanReplacements

      TestBeanReplacements(SimpleContainer container, String module, Map<Class<?>,Object> requests)
      Called only for a class with replacement requests in an in-process handover.
  • Method Details

    • recordComponent

      void recordComponent(Class<?> type, String name)
      Records only successfully discovered components, and only in a test scan.
    • install

      void install(List<Class<?>> configurations, Function<Method,String[]> factoryNames)
      Validates every requested type against discovered declarations before installing any stand-ins. This test-only step does not create configurations, call factories or query a live bean.
    • replaces

      boolean replaces(Method method)
      Whether an in-process scan should skip a factory whose result has already been replaced.
    • recordFactories

      private void recordFactories(Class<?> configuration, Function<Method,String[]> factoryNames)
      Reads factory metadata only for an in-process replacement request, not for a server scan.
    • select

      private TestBeanReplacements.Definition select(Class<?> type, Object instance)
      Resolves against the test module's declarations, without inheriting parent beans or priorities.
    • invalid

      private InvalidTestBeanReplacement invalid(Class<?> type, String reason)
      Reports an invalid test arrangement before the module's components can run.