/** * Protected constructor. Not intended for direct instantiation. * @see MockMvcBuilders#standaloneSetup(Object...) */ protected StandaloneMockMvcBuilder(Object... controllers) { this.controllers = instantiateIfNecessary(controllers); }
/** * Register one or more {@link org.springframework.web.bind.annotation.ControllerAdvice} * instances to be used in tests (specified {@code Class} will be turned into instance). * <p>Normally {@code @ControllerAdvice} are auto-detected as long as they're declared * as Spring beans. However since the standalone setup does not load any Spring config, * they need to be registered explicitly here instead much like controllers. * @since 4.2 */ public StandaloneMockMvcBuilder setControllerAdvice(Object... controllerAdvice) { this.controllerAdvice = instantiateIfNecessary(controllerAdvice); return this; }
/** * Register one or more {@link org.springframework.web.bind.annotation.ControllerAdvice} * instances to be used in tests (specified {@code Class} will be turned into instance). * <p>Normally {@code @ControllerAdvice} are auto-detected as long as they're declared * as Spring beans. However since the standalone setup does not load any Spring config, * they need to be registered explicitly here instead much like controllers. * @since 4.2 */ public StandaloneMockMvcBuilder setControllerAdvice(Object... controllerAdvice) { this.controllerAdvice = instantiateIfNecessary(controllerAdvice); return this; }
/** * Protected constructor. Not intended for direct instantiation. * @see MockMvcBuilders#standaloneSetup(Object...) */ protected StandaloneMockMvcBuilder(Object... controllers) { this.controllers = instantiateIfNecessary(controllers); }