@Test public void lazy_instance_with_functional_interface_adds_instance_factory_customisation_to_the_container() { this.fluentCustomisation.lazyInstance(Number.class, mock(SpecimenSupplier.class)); verify(this.mockCustomisationContainer).customise(isA(InstanceFactoryCustomisation.class)); }
public <T> FluentCustomisation lazyInstance(Type type, SpecimenSupplier<? extends T> supplier) { this.customisationContainer.customise(new InstanceFactoryCustomisation<T>(type, supplier)); return this; }
DefaultFluentCustomisation implements FluentCustomisation { public <T> FluentCustomisation lazyInstance(Type type, SpecimenSupplier<? extends T> supplier) { this.customisationContainer.customise(new InstanceFactoryCustomisation<T>(type, supplier)); return this; } }
DefaultFluentCustomisation implements FluentCustomisation { public <T> FluentCustomisation lazyInstance(Type type, SpecimenSupplier<? extends T> supplier) { this.customisationContainer.customise(new InstanceFactoryCustomisation<T>(type, supplier)); return this; } DefaultFluentCustomisation(CustomisationContainer customisationContainer, MultipleCount multipleCount); }
DefaultFluentCustomisation implements FluentCustomisation { public <T> FluentCustomisation lazyInstance(Type type, SpecimenSupplier<? extends T> supplier) { this.customisationContainer.customise(new InstanceFactoryCustomisation<T>(type, supplier)); return this; } DefaultFluentCustomisation(CustomisationContainer customisationContainer, MultipleCount multipleCount); FluentCustomisation repeatCount(int count); FluentCustomisation sameInstance(Type type, T instance); FluentCustomisation sameInstance(Class<T> clazz, T instance); FluentCustomisation lazyInstance(Type type, SpecimenSupplier<? extends T> supplier); FluentCustomisation lazyInstance(Class<T> clazz, SpecimenSupplier<? extends T> supplier); @Override FluentCustomisation propertyOf(Class<?> clazz, String name, Object value); FluentCustomisation useSubType(Class<T> baseClass, Class<U> subClass); FluentCustomisation add(Customisation customisation); @Override FluentCustomisation intercept(Class<T> classToIntercept, Interceptor<T> interceptor); @Override FluentCustomisation transform(Class<T> classToIntercept, Transformer<T> transformer); RecursionBehaviour circularDependencyBehaviour(); NoResolutionBehaviour noResolutionBehaviour(); AutoPropertyBehaviour autoPropertyBehaviour(); }
DefaultFluentCustomisation implements FluentCustomisation { public <T> FluentCustomisation lazyInstance(Type type, SpecimenSupplier<? extends T> supplier) { this.customisationContainer.customise(new InstanceFactoryCustomisation<T>(type, supplier)); return this; } DefaultFluentCustomisation(CustomisationContainer customisationContainer, MultipleCount multipleCount); FluentCustomisation repeatCount(int count); FluentCustomisation sameInstance(Type type, T instance); FluentCustomisation sameInstance(Class<T> clazz, T instance); FluentCustomisation lazyInstance(Type type, SpecimenSupplier<? extends T> supplier); FluentCustomisation lazyInstance(Class<T> clazz, SpecimenSupplier<? extends T> supplier); @Override FluentCustomisation propertyOf(Class<?> clazz, String name, Object value); FluentCustomisation useSubType(Class<T> baseClass, Class<U> subClass); FluentCustomisation add(Customisation customisation); @Override FluentCustomisation intercept(Class<T> classToIntercept, Interceptor<T> interceptor); @Override FluentCustomisation transform(Class<T> classToIntercept, Transformer<T> transformer); RecursionBehaviour circularDependencyBehaviour(); NoResolutionBehaviour noResolutionBehaviour(); AutoPropertyBehaviour autoPropertyBehaviour();  }