### start Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/socket/sockjs/client/WebSocketTransport.html Starts this component. ```APIDOC ## start() ### Description Start this component. Should not throw an exception if the component is already running. In the case of a container, this will propagate a hard start signal to all components that apply, even to non-auto-startup components. ### See Also * `SmartLifecycle.isAutoStartup()` ``` -------------------------------- ### start Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/socket/messaging/SubProtocolWebSocketHandler.html Starts this component. ```APIDOC ## start() ### Description Start this component. ### Parameters None ### Request Example None ### Response #### Success Response (200) None #### Response Example None ``` -------------------------------- ### start Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/jms/config/JmsListenerEndpointRegistry.html Start this component. Should not throw an exception if the component is already running. ```APIDOC ## start() ### Description Start this component. Should not throw an exception if the component is already running. In the case of a container, this will propagate a hard start signal to all components that apply, even to non-auto-startup components. ### Method `public void start()` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Response #### Success Response (200) None ### See Also * `SmartLifecycle.isAutoStartup()` ``` -------------------------------- ### start() Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/scheduling/concurrent/SimpleAsyncTaskScheduler.html Starts the scheduler, allowing scheduled tasks to begin execution. ```APIDOC ## start() ### Description Starts the scheduler. ### Method `start` ### Parameters - None ### Request Example ```json {} ``` ### Response #### Success Response (200) - None (void method) #### Response Example ```json {} ``` ``` -------------------------------- ### start Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/socket/messaging/WebSocketStompClient.html Starts the WebSocket client. This method should not throw an exception if the client is already running. ```APIDOC ## Method start ### Description Start this component. Should not throw an exception if the component is already running. In the case of a container, this will propagate a hard start signal to all components that apply, even to non-auto-startup components. ### See Also * `SmartLifecycle.isAutoStartup()` ``` -------------------------------- ### start() Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/context/support/AbstractApplicationContext.html Starts this component. This method should not throw an exception if the component is already running. For containers, this propagates a start signal to all components. ```APIDOC ## start() ### Description Start this component. Should not throw an exception if the component is already running. In the case of a container, this will propagate a hard start signal to all components that apply, even to non-auto-startup components. ### Method public void start() ### Parameters None ### Request Example None ### Response None ### Response Example None ``` -------------------------------- ### Lifecycle start Method Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/http/client/reactive/ReactorClientHttpConnector.html Starts the component. Should not throw an exception if the component is already running. ```java public void start() Description copied from interface: `Lifecycle` Start this component. Should not throw an exception if the component is already running. In the case of a container, this will propagate a hard start signal to all components that apply, even to non-auto-startup components. Specified by: `start` in interface `Lifecycle` ``` -------------------------------- ### start Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/jms/listener/DefaultMessageListenerContainer.html Starts the listener container, overriding the default behavior to reset any stop callbacks. ```APIDOC ## start ### Description Overridden to reset the stop callback, if any. ### Method `public void start() throws JmsException` ### Specified by `start` in interface `Lifecycle` ### Overrides `start` in class `AbstractJmsListeningContainer` ### Throws `JmsException` - if starting failed ### See Also * `AbstractJmsListeningContainer.doStart()` ``` -------------------------------- ### WebClient GET Request Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/reactive/function/client/class-use/WebClient.RequestHeadersUriSpec.html Starts building an HTTP GET request using WebClient. ```APIDOC ## GET ### Description Starts building an HTTP GET request. ### Method GET ### Endpoint [Specify endpoint here] ### Parameters #### Path Parameters None explicitly documented. #### Query Parameters None explicitly documented. #### Request Body None explicitly documented. ### Request Example ```json { "example": "No request body example provided" } ``` ### Response #### Success Response (200) - **Type**: WebClient.RequestHeadersUriSpec #### Response Example ```json { "example": "No response body example provided" } ``` ``` -------------------------------- ### ApplicationStartup.start Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/metrics/class-use/StartupStep.html Creates a new startup step and marks its beginning. This method returns a StartupStep instance that can be further configured. ```APIDOC ## ApplicationStartup.start ### Description Creates a new startup step and marks its beginning. This method returns a StartupStep instance that can be further configured. ### Method (Implicitly invoked when creating a step) ### Endpoint N/A (Method call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```java StartupStep step = applicationStartup.start("MyCustomStep"); ``` ### Response #### Success Response - **StartupStep** (StartupStep) - The newly created startup step. ``` -------------------------------- ### start Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/jms/connection/SingleConnectionFactory.html Initializes the underlying shared connection. ```APIDOC ## start ### Description Initializes the underlying shared JMS connection. This method is called automatically when the component starts, as it implements the `Lifecycle` interface. ### Method `public void start()` ### Since 6.1 ``` -------------------------------- ### Setup RestTestClient with WebApplicationContext Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/test/web/servlet/client/RestTestClient.html Use 'bindToApplicationContext(WebApplicationContext context)' to start creating a RestTestClient with a WebApplicationContext setup. ```java static RestTestClient.WebAppContextSetupBuilder bindToApplicationContext(WebApplicationContext context) ``` -------------------------------- ### Prepare HTTP GET Request with WebTestClient Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/test/web/reactive/server/WebTestClient.html Use the `get()` method to start preparing an HTTP GET request. This returns a spec for specifying the target URL. ```java WebTestClient.RequestHeadersUriSpec get() ``` -------------------------------- ### ApplicationStartup Interface Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/metrics/ApplicationStartup.html Provides methods to instrument the application startup phase by creating named steps. ```APIDOC ## Interface: ApplicationStartup ### Description Instruments the application startup phase using `steps`. The core container and its infrastructure components can use the `ApplicationStartup` to mark steps during the application startup and collect data about the execution context or their processing time. ### Methods #### `start(String name)` ##### Description Create a new step and marks its beginning. A step name describes the current action or phase. This technical name should be '.' namespaced and can be reused to describe other instances of the same step during application startup. ##### Parameters - **name** (String) - The step name. ##### Returns - `StartupStep` - An object representing the newly created step. ``` -------------------------------- ### isAutoStartup Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/jms/listener/AbstractJmsListeningContainer.html Returns `true` if this `Lifecycle` component should get started automatically by the container at the time that the containing `ApplicationContext` gets refreshed or restarted. A value of `false` indicates that the component is intended to be started through an explicit `Lifecycle.start()` call instead. ```APIDOC ## isAutoStartup ### Description Check if the container is configured to start automatically. ### Method GET ### Endpoint /jms/listener/container/autoStartup ### Response #### Success Response (200) - **autoStartup** (boolean) - True if auto-startup is enabled, false otherwise. #### Response Example ```json { "autoStartup": false } ``` ``` -------------------------------- ### FlightRecorderApplicationStartup.start Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/metrics/class-use/StartupStep.html Creates a new startup step and marks its beginning using Java Flight Recorder. This method returns a StartupStep instance. ```APIDOC ## FlightRecorderApplicationStartup.start ### Description Creates a new startup step and marks its beginning using Java Flight Recorder. This method returns a StartupStep instance. ### Method (Implicitly invoked when creating a step) ### Endpoint N/A (Method call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```java StartupStep step = flightRecorderApplicationStartup.start("JFRStep"); ``` ### Response #### Success Response - **StartupStep** (StartupStep) - The newly created startup step. ``` -------------------------------- ### Get Start Position of AST Node Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/expression/spel/ast/SpelNodeImpl.html Retrieves the starting index of this AST node within the expression string. Inherited from the SpelNode interface. ```Java public int getStartPosition() Description copied from interface: SpelNode Return the start position of this AST node in the expression string. Specified by: `getStartPosition` in interface `SpelNode` Returns: the start position ``` -------------------------------- ### Application Startup Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/beans/factory/config/ConfigurableBeanFactory.html Methods for setting and retrieving the ApplicationStartup. ```APIDOC ## getApplicationStartup ### Description Returns the ApplicationStartup for this bean factory. ### Method ApplicationStartup ### Signature getApplicationStartup() ``` ```APIDOC ## setApplicationStartup ### Description Sets the ApplicationStartup for this bean factory. ### Method void ### Signature setApplicationStartup(ApplicationStartup applicationStartup) ``` -------------------------------- ### Setup RestTestClient with RouterFunction using MockMvc Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/test/web/servlet/client/RestTestClient.html Use 'bindToRouterFunction(RouterFunction... routerFunctions)' to start creating a RestTestClient with a RouterFunction MockMvc setup. ```java static RestTestClient.RouterFunctionSetupBuilder bindToRouterFunction(RouterFunction... routerFunctions) ``` -------------------------------- ### StartupStep Interface Methods Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/metrics/StartupStep.html This section details the methods available on the StartupStep interface for managing and recording startup metrics. ```APIDOC ## StartupStep Interface ### Description Represents a step in the application startup process, used for recording metrics and metadata. ### Methods #### `getName()` * **Description**: Returns the name of the startup step. This technical name should be '.' namespaced and can be reused. * **Return Type**: `String` #### `getId()` * **Description**: Returns the unique ID for this step within the application startup. * **Return Type**: `long` #### `getParentId()` * **Description**: Returns the ID of the parent step, if available. The parent step is the one that was most recently started when the current step was created. * **Return Type**: `@Nullable Long` #### `tag(String key, String value)` * **Description**: Adds a `StartupStep.Tag` to the step with the given key and value. * **Parameters**: * `key` (String) - The tag key. * `value` (String) - The tag value. * **Return Type**: `StartupStep` #### `tag(String key, Supplier value)` * **Description**: Adds a `StartupStep.Tag` to the step with the given key and a supplier for the tag value. * **Parameters**: * `key` (String) - The tag key. * `value` (Supplier) - A supplier for the tag value. * **Return Type**: `StartupStep` #### `getTags()` * **Description**: Returns the collection of `StartupStep.Tag` for this step. * **Return Type**: `StartupStep.Tags` #### `end()` * **Description**: Records the state of the step and possibly other metrics like execution time. Changes to the step state are not allowed after this method is called. * **Return Type**: `void` #### `close()` * **Description**: Closes the startup step, performing any necessary cleanup. This method is part of the `AutoCloseable` interface. * **Return Type**: `void` ``` -------------------------------- ### Setup RestTestClient with Controllers using MockMvc Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/test/web/servlet/client/RestTestClient.html Use 'bindToController(Object... controllers)' to start creating a RestTestClient with a Standalone MockMvc setup. ```java static RestTestClient.StandaloneSetupBuilder bindToController(Object... controllers) ``` -------------------------------- ### Route GET requests for /user Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/reactive/function/server/RouterFunctions.html Routes GET requests for the path "/user" to the `listUsers` method in `userController`. This is a basic example of defining a single route. ```java RouterFunction route = RouterFunctions.route(RequestPredicates.GET("/user"), userController::listUsers); ``` -------------------------------- ### Sybase Sequence Table Setup Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/jdbc/support/incrementer/SybaseMaxValueIncrementer.html Example SQL statements to create a table for storing sequence values and insert an initial value. This setup is required when using SybaseMaxValueIncrementer. ```sql create table tab (id int not null primary key, text varchar(100)) create table tab_sequence (id bigint identity) insert into tab_sequence values() ``` -------------------------------- ### PropertyResolver get Operator Source: https://docs.spring.io/spring-framework/docs/current/kdoc-api/spring-core/org.springframework.core.env/get.html The `get` operator allows you to retrieve a property value directly using string key. It returns a nullable String, and an example demonstrates its usage with a default value. ```APIDOC ## get Operator ### Description Provides an array-like getter for `PropertyResolver` to retrieve a property value by its key. Returns a nullable String. ### Method Signature `operator fun PropertyResolver.get(key: String): String?` ### Usage Example ```kotlin val name = env["name"] ?: "Seb" ``` ### Parameters * **key** (String) - The key of the property to retrieve. ### Returns * (String?) - The property value as a nullable String, or null if the property is not found. ``` -------------------------------- ### StartupStep.Tag Interface Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/metrics/StartupStep.Tag.html Provides methods to retrieve the key and value of a tag associated with a startup step. ```APIDOC ## Interface: StartupStep.Tag ### Description Simple key/value association for storing step metadata. ### Methods #### getKey ```java String getKey() ``` **Description:** Return the `Tag` name. #### getValue ```java String getValue() ``` **Description:** Return the `Tag` value. ``` -------------------------------- ### apply Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/test/web/servlet/setup/ConfigurableMockMvcBuilder.html Adds a MockMvcConfigurer to automate MockMvc setup. ```APIDOC ## apply configurer ### Description Add a `MockMvcConfigurer` that automates MockMvc setup and configures it for some specific purpose (for example, security). ### Method `apply` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) None #### Response Example None ``` -------------------------------- ### FixedBackOff Methods Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/util/backoff/FixedBackOff.html Provides methods to get and set the interval and maximum attempts, and to start a back-off execution. ```APIDOC ## getInterval() ### Description Return the interval between two attempts in milliseconds. ### Method `long getInterval()` ``` ```APIDOC ## getMaxAttempts() ### Description Return the maximum number of back-off attempts. Note that in a retry scenario, this is equivalent to the maximum number of retries excluding the original invocation. ### Method `long getMaxAttempts()` ``` ```APIDOC ## setInterval(long interval) ### Description Set the interval between two attempts in milliseconds. ### Parameters * **interval** (long) - the interval between two attempts in milliseconds ### Method `void setInterval(long interval)` ``` ```APIDOC ## setMaxAttempts(long maxAttempts) ### Description Set the maximum number of back-off attempts. Note that in a retry scenario, this is equivalent to the maximum number of retries excluding the original invocation. ### Parameters * **maxAttempts** (long) - the maximum number of back-off attempts ### Method `void setMaxAttempts(long maxAttempts)` ``` ```APIDOC ## start() ### Description Start a new back off execution. ### Method `BackOffExecution start()` ### Returns a fresh `BackOffExecution` ready to be used ``` -------------------------------- ### StartupStep.Tags Interface Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/metrics/StartupStep.Tags.html Provides an immutable collection of StartupStep.Tag and supports iteration. ```APIDOC ## Interface: StartupStep.Tags ### Description An immutable collection of `StartupStep.Tag`. This interface extends `Iterable` allowing for iteration over the tags. ### Type Interface ### Implements `Iterable` ### Methods Inherited from Iterable - `forEach(Consumer action)`: Performs the given action for each element of the Iterable until all elements have been processed or the action has thrown an exception. - `iterator()`: Returns an iterator over elements of type `StartupStep.Tag`. - `spliterator()`: Returns a Spliterator over the elements of type `StartupStep.Tag`. ``` -------------------------------- ### Example FruitMap Class Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/expression/spel/support/ReflectiveIndexAccessor.html A class representing a map indexed by Color, with methods for getting and setting fruit. ```java public class FruitMap { private final Map map = new HashMap<>(); public FruitMap() { this.map.put(Color.RED, "cherry"); this.map.put(Color.ORANGE, "orange"); this.map.put(Color.YELLOW, "banana"); } public String getFruit(Color color) { return this.map.get(color); } public void setFruit(Color color, String fruit) { this.map.put(color, fruit); } } ``` -------------------------------- ### Methods Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/jca/support/SimpleBootstrapContext.html Details the instance methods available on the SimpleBootstrapContext class. ```APIDOC ## Method Summary ### `Timer createTimer()` Creates a new `java.util.Timer` instance. **Returns:** * `Timer` - a new Timer instance **Throws:** * `jakarta.resource.spi.UnavailableException` - if a Timer cannot be created ### `getTransactionSynchronizationRegistry()` Returns the `TransactionSynchronizationRegistry` provided during construction. **Returns:** * `@Nullable jakarta.transaction.TransactionSynchronizationRegistry` - the TransactionSynchronizationRegistry, or null if none was provided ### `getWorkManager()` Returns the `WorkManager` provided during construction. **Returns:** * `jakarta.resource.spi.work.WorkManager` - the WorkManager ### `getXATerminator()` Returns the `XATerminator` provided during construction. **Returns:** * `@Nullable jakarta.resource.spi.XATerminator` - the XATerminator, or null if none was provided ### `isContextSupported(Class workContextClass)` Checks if the given `WorkContext` class is supported by this `BootstrapContext`. **Parameters:** * `workContextClass` (Class) - the `WorkContext` class to check **Returns:** * `boolean` - true if the context is supported, false otherwise ``` -------------------------------- ### RestClient.get() Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/client/class-use/RestClient.RequestHeadersUriSpec.html Starts building an HTTP GET request. This method returns a RestClient.RequestHeadersUriSpec, allowing further configuration of headers and URI. ```APIDOC ## RestClient.get() ### Description Starts building an HTTP GET request. ### Method GET ### Endpoint [Not specified in source] ### Parameters [Not specified in source] ### Request Example [Not specified in source] ### Response [Not specified in source] ``` -------------------------------- ### EncoderHttpMessageWriter.getWriteHints Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/class-use/ResolvableType.html Get additional hints for encoding, for example, based on the server request or annotations from controller method parameters. ```APIDOC ## EncoderHttpMessageWriter.getWriteHints ### Description Get additional hints for encoding, for example, based on the server request or annotations from controller method parameters. ### Method (Not specified, likely a method call within the framework) ### Endpoint (Not applicable, this is an SDK method) ### Parameters - **streamType** (ResolvableType) - Description not specified - **elementType** (ResolvableType) - Description not specified - **mediaType** (MediaType) - Description not specified - **request** (ServerHttpRequest) - Description not specified - **response** (ServerHttpResponse) - Description not specified ### Return Type protected Map ``` -------------------------------- ### Configuration and Metadata Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/context/support/AbstractApplicationContext.html Methods for setting the environment, display name, ID, parent context, and application startup. ```APIDOC ## setApplicationStartup(ApplicationStartup applicationStartup) ### Description Sets the `ApplicationStartup` for this application context. ### Method void ### Endpoint N/A (Method Call) ### Parameters * **applicationStartup** (ApplicationStartup) - The ApplicationStartup instance to set. ### Response None ``` ```APIDOC ## setDisplayName(String displayName) ### Description Sets a friendly name for this context. ### Method void ### Endpoint N/A (Method Call) ### Parameters * **displayName** (String) - The friendly name for the application context. ### Response None ``` ```APIDOC ## setEnvironment(ConfigurableEnvironment environment) ### Description Sets the `Environment` for this application context. ### Method void ### Endpoint N/A (Method Call) ### Parameters * **environment** (ConfigurableEnvironment) - The ConfigurableEnvironment instance to set. ### Response None ``` ```APIDOC ## setId(String id) ### Description Sets the unique id of this application context. ### Method void ### Endpoint N/A (Method Call) ### Parameters * **id** (String) - The unique identifier for the application context. ### Response None ``` ```APIDOC ## setParent(@Nullable ApplicationContext parent) ### Description Sets the parent of this application context. ### Method void ### Endpoint N/A (Method Call) ### Parameters * **parent** (ApplicationContext) - The parent ApplicationContext. Can be null. ### Response None ``` -------------------------------- ### SpelMessage Values Example Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/expression/spel/SpelMessage.html Illustrates how to get an array of all SpelMessage enum constants. This can be used for iteration or inspection of all possible messages. ```java static SpelMessage[] values() ``` -------------------------------- ### FlightRecorderApplicationStartup Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/metrics/jfr/FlightRecorderApplicationStartup.html Provides an ApplicationStartup implementation that records StartupStep events as Java Flight Recorder events. StartupStep.Tags are serialized as a single String attribute due to JFR event limitations. To use, configure this on the application context and launch the application with JFR recording enabled. ```APIDOC ## Class: FlightRecorderApplicationStartup ### Description An `ApplicationStartup` implementation for Java Flight Recorder. This class records `StartupStep` as Flight Recorder events. Since JFR events only support base types, `StartupStep.Tags` are serialized as a single String attribute. To use, configure this on the application context and launch the application with recording enabled (e.g., `java -XX:StartFlightRecording:filename=recording.jfr,duration=10s -jar app.jar`). ### Implements `ApplicationStartup` ### Constructor #### `FlightRecorderApplicationStartup()` Creates a new `FlightRecorderApplicationStartup` instance. ### Methods #### `start(String name)` Creates a new step and marks its beginning. A step name describes the current action or phase, should be '.' namespaced, and can be reused to describe other instances of the same step during application startup. **Parameters:** - `name` (String) - The name of the step to create. ``` -------------------------------- ### DecoderHttpMessageReader.getReadHints (1) Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/class-use/ResolvableType.html Get additional hints for decoding, for example, based on the server request or annotations from controller method parameters. ```APIDOC ## DecoderHttpMessageReader.getReadHints (1) ### Description Get additional hints for decoding, for example, based on the server request or annotations from controller method parameters. ### Method (Not specified, likely a method call within the framework) ### Endpoint (Not applicable, this is an SDK method) ### Parameters - **actualType** (ResolvableType) - Description not specified - **elementType** (ResolvableType) - Description not specified - **request** (ServerHttpRequest) - Description not specified - **response** (ServerHttpResponse) - Description not specified ### Return Type protected Map ``` -------------------------------- ### Setup RestTestClient with Existing MockMvc Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/test/web/servlet/client/RestTestClient.html Use 'bindTo(MockMvc mockMvc)' to start creating a RestTestClient by providing an initialized MockMvc instance. ```java static RestTestClient.Builder bindTo(MockMvc mockMvc) ``` -------------------------------- ### Basic MockMvcWebConnection Setup Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/test/web/servlet/htmlunit/MockMvcWebConnection.html Demonstrates how to initialize MockMvcWebConnection and integrate it with HtmlUnit's WebClient. This setup is crucial for enabling MockMvc to handle web requests within the HtmlUnit environment. ```java WebClient webClient = new WebClient(); MockMvc mockMvc = ... MockMvcWebConnection webConnection = new MockMvcWebConnection(mockMvc, webClient); webClient.setWebConnection(webConnection); // Use webClient as normal ... ``` -------------------------------- ### Get Expression Prefix Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/expression/ParserContext.html Retrieves the prefix used to identify the start of an expression block in template expressions. The default prefix is "#{". ```java String getExpressionPrefix() ``` -------------------------------- ### beforeTestMethod Method Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/test/context/transaction/TransactionalTestExecutionListener.html Manages transaction setup before a test method executes, including running @BeforeTransaction methods and starting a new transaction if configured. ```APIDOC ## beforeTestMethod ### Description If the test method of the supplied test context is configured to run within a transaction, this method will run `@BeforeTransaction` methods and start a new transaction. Note that if a `@BeforeTransaction` method fails, any remaining `@BeforeTransaction` methods will not be invoked, and a transaction will not be started. ### Method `public void beforeTestMethod(TestContext testContext) throws Exception` ### Implements `beforeTestMethod` in interface `TestExecutionListener` ### Overrides `beforeTestMethod` in class `AbstractTestExecutionListener` ### Parameters * `testContext` (TestContext) - Required - The test context in which the test method will be executed; never null ### Throws * `Exception` - Allows any exception to propagate ``` -------------------------------- ### onStartup Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/servlet/support/AbstractDispatcherServletInitializer.html Configures the ServletContext with necessary components for initializing the web application, including servlets, filters, listeners, and context parameters. This method is part of the WebApplicationInitializer interface. ```APIDOC ## Method Details ### onStartup `public void onStartup(jakarta.servlet.ServletContext servletContext) throws jakarta.servlet.ServletException` Description copied from interface: `WebApplicationInitializer` Configure the given `ServletContext` with any servlets, filters, listeners context-params and attributes necessary for initializing this web application. See examples above. Specified by: `onStartup` in interface `WebApplicationInitializer` Overrides: `onStartup` in class `AbstractContextLoaderInitializer` Parameters: `servletContext` - the `ServletContext` to initialize Throws: `jakarta.servlet.ServletException` - if any call against the given `ServletContext` throws a `ServletException` ``` -------------------------------- ### initialize Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/jms/listener/AbstractJmsListeningContainer.html Initialize this container. Marks the container as active and calls `doInitialize()`. Throws `JmsException` if startup failed. ```APIDOC ## initialize ### Description Initializes the JMS listening container. ### Method POST ### Endpoint /jms/listener/container/initialize ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating successful initialization. #### Response Example ```json { "message": "Container initialized successfully." } ``` ``` -------------------------------- ### onSuppressedException(Exception) Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/index-files/index-15.html Register an exception that happened to get suppressed during the creation of a singleton bean instance, for example, a temporary circular reference resolution problem. ```APIDOC ## onSuppressedException(Exception) ### Description Register an exception that happened to get suppressed during the creation of a singleton bean instance, for example, a temporary circular reference resolution problem. ### Method N/A ### Endpoint N/A ``` -------------------------------- ### Configure Mustache Script Template Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/servlet/view/script/ScriptTemplateConfigurer.html Example of configuring ScriptTemplateConfigurer for Mustache.js using Nashorn engine. This setup is typically done within an @Configuration class. ```java @Bean public ScriptTemplateConfigurer mustacheConfigurer() { ScriptTemplateConfigurer configurer = new ScriptTemplateConfigurer(); configurer.setEngineName("nashorn"); configurer.setScripts("mustache.js"); configurer.setRenderObject("Mustache"); configurer.setRenderFunction("render"); return configurer; } ``` -------------------------------- ### DEFAULT ApplicationStartup Implementation Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/metrics/ApplicationStartup.html A default "no op" implementation of ApplicationStartup designed for minimal overhead and does not record data. ```APIDOC ## Field: DEFAULT ### Description Default "no op" `ApplicationStartup` implementation. This variant is designed for minimal overhead and does not record data. ``` -------------------------------- ### Initialize WebTestClient with an Application Context Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/test/web/servlet/client/MockMvcWebTestClient.html Begin creating a WebTestClient by providing a WebApplicationContext. This method is equivalent to using MockMvcBuilders.webAppContextSetup. ```java MockMvcWebTestClient.bindToApplicationContext(context) ``` -------------------------------- ### Get JmsClient Builder with JmsTemplate Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/jms/core/JmsClient.html Obtains a builder for creating a JmsClient, initialized with the configuration of a given JmsOperations instance. This is useful for customizing an existing JmsTemplate setup. ```java static JmsClient.Builder builder(JmsOperations jmsTemplate) ``` -------------------------------- ### XML: Calling Static and Instance Methods for System Properties Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/beans/factory/config/MethodInvokingFactoryBean.html Demonstrates calling a static method to get properties, then an instance method to retrieve a specific Java system property. ```xml ``` -------------------------------- ### SybaseAnywhereMaxValueIncrementer Sequence Table Setup Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/jdbc/support/incrementer/SybaseAnywhereMaxValueIncrementer.html Example SQL statements to create a table and its corresponding sequence table for use with SybaseAnywhereMaxValueIncrementer. The sequence table should not be an IDENTITY column itself. ```sql create table tab (id int not null primary key, text varchar(100)) create table tab_sequence (id bigint identity) insert into tab_sequence values(DEFAULT) ``` -------------------------------- ### Nested Routes with Builder Consumer Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/reactive/function/server/RouterFunctions.Builder.html Creates nested routes using a builder consumer for a shared path predicate. This example defines GET and POST handlers for /user. ```java RouterFunction nestedRoute = RouterFunctions.route() .nest(RequestPredicates.path("/user"), builder -> builder.GET(this::listUsers).POST(this::createUser)) .build(); ``` -------------------------------- ### webAppContextSetup(WebApplicationContext, MockMvcConfigurer) Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/index-files/index-23.html Builds a MockMvc instance using a provided WebApplicationContext and MockMvcConfigurer. This allows for custom configuration during testing. ```APIDOC ## webAppContextSetup(WebApplicationContext, MockMvcConfigurer) ### Description Builds a MockMvc instance using the supplied `WebApplicationContext` and `MockMvcConfigurer`. This allows for custom configuration during testing. ### Method Static method ### Endpoint N/A (This is a Java method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```java MockMvc mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext, mockMvcConfigurer).build(); ``` ### Response #### Success Response A configured `MockMvc` instance. #### Response Example N/A ``` -------------------------------- ### Async Dispatch Example Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/test/web/servlet/request/MockMvcRequestBuilders.html Demonstrates the usage of asyncDispatch. First, a request is performed that starts async processing and returns an MvcResult. Then, asyncDispatch is used with that MvcResult to complete the processing. ```java MvcResult mvcResult = this.mockMvc.perform(get("/1")) .andExpect(request().asyncStarted()) .andReturn(); this.mockMvc.perform(asyncDispatch(mvcResult)) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON)) .andExpect(content().string("{\"name\":\"Joe\",\"someDouble\":0.0,\"someBoolean\":false}")); ``` -------------------------------- ### Recommended AnnotationConfigApplicationContext Initialization Source: https://docs.spring.io/spring-framework/docs/current/kdoc-api/spring-context/org.springframework.context.annotation/-annotation-config-application-context.html This snippet demonstrates the recommended way to initialize an `AnnotationConfigApplicationContext` using the `apply` method, which achieves the same block-style initialization as the deprecated constructor. ```kotlin AnnotationConfigApplicationContext().apply(configure) ``` -------------------------------- ### HSQL Table and Sequence Setup Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/jdbc/support/incrementer/HsqlMaxValueIncrementer.html Example SQL statements to create a table and its corresponding sequence table for HsqlMaxValueIncrementer. The sequence table stores the current maximum value. ```sql create table tab (id int not null primary key, text varchar(100)); create table tab_sequence (value identity); insert into tab_sequence values(0); ``` -------------------------------- ### StartupStep.tag (String, String) Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/metrics/class-use/StartupStep.html Adds a tag with a key-value pair to the current StartupStep. Tags can be used to provide additional context to the startup metrics. ```APIDOC ## StartupStep.tag (String key, String value) ### Description Adds a tag with a key-value pair to the current StartupStep. Tags can be used to provide additional context to the startup metrics. ### Method (Implicitly invoked on a StartupStep instance) ### Endpoint N/A (Method call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```java step.tag("http.status_code", "200"); ``` ### Response #### Success Response (No explicit return value, modifies the StartupStep instance) ``` -------------------------------- ### Creating a RouterFunction with CoRouterFunctionDsl Source: https://docs.spring.io/spring-framework/docs/current/kdoc-api/spring-webflux/org.springframework.web.reactive.function.server/co-router.html This example demonstrates how to define routes for HTML and JSON content types using the coRouter DSL. It includes GET and POST mappings for user-related endpoints. ```kotlin import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration import org.springframework.http.MediaType.APPLICATION_JSON import org.springframework.http.MediaType.TEXT_HTML import org.springframework.web.reactive.function.server.RouterFunction import org.springframework.web.reactive.function.server.ServerResponse import org.springframework.web.reactive.function.server.bodyValueAndAwait import org.springframework.web.reactive.function.server.coRouter @Configuration class RouterConfiguration { @Bean fun mainRouter(userHandler: UserHandler) = coRouter { accept(TEXT_HTML).nest { (GET("/user/") or GET("/users/")).invoke(userHandler::findAllView) GET("/users/{login}", userHandler::findViewById) } accept(APPLICATION_JSON).nest { (GET("/api/user/") or GET("/api/users/")).invoke(userHandler::findAll) POST("/api/users/", userHandler::create) } } } // Dummy UserHandler and User classes for compilation class UserHandler { ssuspend fun findAllView(request: org.springframework.web.reactive.function.server.ServerRequest): ServerResponse = ServerResponse.ok().bodyValueAndAwait("findAllView") suspend fun findViewById(request: org.springframework.web.reactive.function.server.ServerRequest): ServerResponse = ServerResponse.ok().bodyValueAndAwait("findViewById") ssuspend fun findAll(request: org.springframework.web.reactive.function.server.ServerRequest): ServerResponse = ServerResponse.ok().bodyValueAndAwait("findAll") ssuspend fun create(request: org.springframework.web.reactive.function.server.ServerRequest): ServerResponse = ServerResponse.ok().bodyValueAndAwait("create") } data class User(val login: String) ``` -------------------------------- ### Nested Routes with Path Predicate Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/reactive/function/server/RouterFunctions.Builder.html Creates nested routes where a group of routes share a common path predicate. This example shows defining GET and POST handlers for /user. ```java RouterFunction nestedRoute = RouterFunctions.route() .nest(RequestPredicates.path("/user"), () -> RouterFunctions.route() .GET(this::listUsers) .POST(this::createUser) .build()) .build(); ``` -------------------------------- ### initialize Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/scheduling/quartz/LocalDataSourceJobStore.html Initializes the JobStore with the provided ClassLoadHelper and SchedulerSignaler. ```APIDOC ## initialize(ClassLoadHelper loadHelper, SchedulerSignaler signaler) ### Description Initializes the JobStore with the necessary components for its operation. ### Method public void initialize(ClassLoadHelper loadHelper, SchedulerSignaler signaler) ### Throws SchedulerConfigException ``` -------------------------------- ### end() - StartupStep Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/index-files/index-5.html Record the state of the step and possibly other metrics like execution time. ```APIDOC ## end() ### Description Record the state of the step and possibly other metrics like execution time. ### Method Method in interface org.springframework.core.metrics.StartupStep ``` -------------------------------- ### setAllowRawInjectionDespiteWrapping Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.html Set whether to allow the raw injection of a bean instance into some other bean's property, despite the injected bean eventually getting wrapped (for example, through AOP auto-proxying). ```APIDOC ## setAllowRawInjectionDespiteWrapping ### Description Set whether to allow the raw injection of a bean instance into some other bean's property, despite the injected bean eventually getting wrapped (for example, through AOP auto-proxying). ### Method void ### Signature setAllowRawInjectionDespiteWrapping(boolean allowRawInjectionDespiteWrapping) ### Parameters - **allowRawInjectionDespiteWrapping** (boolean) - True to allow raw injection despite wrapping, false otherwise. ``` -------------------------------- ### Strategy and Initialization Methods Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/servlet/DispatcherServlet.html Methods for initializing strategies and retrieving default configurations. ```APIDOC ## Strategy and Initialization Methods ### `initStrategies(ApplicationContext context)` **Description:** Initializes the strategy objects that this servlet uses. ### `onRefresh(ApplicationContext context)` **Description:** This implementation calls `initStrategies(ApplicationContext)`. ### `createDefaultStrategy(ApplicationContext context, Class clazz)` **Description:** Creates a default strategy. ### `getDefaultStrategies(ApplicationContext context, Class strategyInterface)` **Description:** Creates a List of default strategy objects for the given strategy interface. ### `getDefaultStrategy(ApplicationContext context, Class strategyInterface)` **Description:** Returns the default strategy object for the given strategy interface. ### `getHandlerMappings()` **Description:** Returns the configured `HandlerMapping` beans that were detected by type in the `WebApplicationContext` or initialized based on the default set of strategies from DispatcherServlet.properties. ### `getMultipartResolver()` **Description:** Obtains this servlet's MultipartResolver, if any. ``` -------------------------------- ### BackOff Usage Example Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/util/backoff/BackOff.html Demonstrates the typical usage pattern of the BackOff interface. It shows how to start a back-off execution and use the nextBackOff() method to determine the retry interval or to stop retrying. ```java BackOffExecution execution = backOff.start(); // In the operation recovery/retry loop: long waitInterval = execution.nextBackOff(); if (waitInterval == BackOffExecution.STOP) { // do not retry operation } else { // sleep, for example, Thread.sleep(waitInterval) // retry operation } ``` -------------------------------- ### Constructor Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/context/support/StaticWebApplicationContext.html Initializes a new instance of the StaticWebApplicationContext class. ```APIDOC ## Constructor ### StaticWebApplicationContext `public StaticWebApplicationContext()` Initializes a new instance of the StaticWebApplicationContext class. ``` -------------------------------- ### Bean Naming Convention Example Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/context/annotation/AnnotationBeanNameGenerator.html Demonstrates how bean names are derived from class names when no explicit name is provided in the annotation. It shows the convention for camel-cased names and names starting with uppercase acronyms. ```java com.xyz.FooServiceImpl -> fooServiceImpl com.xyz.URLFooServiceImpl -> URLFooServiceImpl ``` -------------------------------- ### SQL Server Table and Sequence Setup Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/jdbc/support/incrementer/SqlServerMaxValueIncrementer.html Example SQL statements to create a table and a corresponding sequence table for use with SqlServerMaxValueIncrementer. Ensure the sequence table has an identity column and an initial value. ```sql create table tab (id int not null primary key, text varchar(100)) create table tab_sequence (id bigint identity) insert into tab_sequence default values ``` -------------------------------- ### MockMvcTester.from(WebApplicationContext) Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/index-files/index-6.html Shortcut to create an instance using the given fully initialized (i.e., refreshed) WebApplicationContext. ```APIDOC ## MockMvcTester.from(WebApplicationContext webApplicationContext) ### Description Shortcut to create an instance using the given fully initialized (i.e., refreshed) WebApplicationContext. ### Method static ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Bind to Controller for Mock Server Testing Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/test/web/reactive/server/WebTestClient.html Use `bindToController(Object... controllers)` to start creating a `WebTestClient` with a mock server setup that tests a single `@Controller`. This requires `@EnableWebFlux` equivalent configuration. ```java static WebTestClient.ControllerSpec bindToController(Object... controllers) ``` -------------------------------- ### Initialize WebTestClient with an Existing MockMvc Instance Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/test/web/servlet/client/MockMvcWebTestClient.html Begin creating a WebTestClient by providing an already initialized MockMvc instance. This allows reusing an existing MockMvc setup. ```java MockMvcWebTestClient.bindTo(mockMvc) ``` -------------------------------- ### Create nested routes with a path prefix Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/reactive/function/server/RouterFunctions.html Creates nested routes where a group of routes share a common path prefix. This example nests routes for GET and POST requests under the "/user" path. ```java RouterFunction userRoutes = RouterFunctions.route(RequestPredicates.method(HttpMethod.GET), this::listUsers) .andRoute(RequestPredicates.method(HttpMethod.POST), this::createUser); RouterFunction nestedRoute = RouterFunctions.nest(RequestPredicates.path("/user"), userRoutes); ``` -------------------------------- ### Mock System Environment for Testing Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/core/env/ConfigurableEnvironment.html Illustrates how to replace the system environment property source with a mock for testing purposes, allowing custom property values. ```java MutablePropertySources propertySources = environment.getPropertySources(); MockPropertySource mockEnvVars = new MockPropertySource().withProperty("xyz", "myValue"); propertySources.replace(StandardEnvironment.SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME, mockEnvVars); ``` -------------------------------- ### Programmatic Web Application Initialization Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/WebApplicationInitializer.html Implement WebApplicationInitializer to configure ServletContext programmatically, replacing web.xml. This example sets up both the root application context and the dispatcher servlet's context using @Configuration classes. ```java public class MyWebAppInitializer implements WebApplicationInitializer { @Override public void onStartup(ServletContext container) { // Create the 'root' Spring application context AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext(); rootContext.register(AppConfig.class); // Manage the lifecycle of the root application context container.addListener(new ContextLoaderListener(rootContext)); // Create the dispatcher servlet's Spring application context AnnotationConfigWebApplicationContext dispatcherContext = new AnnotationConfigWebApplicationContext(); dispatcherContext.register(DispatcherConfig.class); // Register and map the dispatcher servlet ServletRegistration.Dynamic dispatcher = container.addServlet("dispatcher", new DispatcherServlet(dispatcherContext)); dispatcher.setLoadOnStartup(1); dispatcher.addMapping("/"); } } ``` -------------------------------- ### prepareSingletonBootstrap Source: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/beans/factory/support/DefaultListableBeanFactory.html Marks the current thread as the main bootstrap thread for singleton instantiation. ```APIDOC ## prepareSingletonBootstrap ### Description Mark current thread as main bootstrap thread for singleton instantiation, with lenient bootstrap locking applying for background threads. ### Method `prepareSingletonBootstrap()` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Response #### Success Response (void) - This method does not return a value. ### Response Example ```json { "example": "" } ``` ```