Class SuppliedBean<B>


  • public class SuppliedBean<B>
    extends Object
    Holds beans supplied to the dependency injection.

    These are typically test doubles or mock instances that we supply in testing. When we supply bean instances they take precedence over other beans that would normally be injected.

    • Constructor Detail

      • SuppliedBean

        public SuppliedBean​(Class<B> type,
                            B bean)
        Create with a given target type and bean instance.
    • Method Detail

      • getType

        public Class<BgetType()
        Return the dependency injection target type.
      • getBean

        public B getBean()
        Return the bean instance to use (often a test double or mock).