@MediaType(value="*/*",
strict=false)
@Alias(value="server-endpoint")
public class HTTPMockServerEndpointSource
extends org.mule.runtime.extension.api.runtime.source.Source<InputStream,HTTPMockRequestAttributes>
This source is intended for use in MUnit tests, where an embedded HTTP server responds to incoming requests and delegates the
request payload to the configured Mule flow using SourceCallback.
It registers a path-specific handler on startup and removes it on stop. The embedded server is provided by the
HTTPMockServer connection, allowing central server management across multiple endpoint sources.
Responses from flows are asynchronously collected and sent back to the corresponding HTTP clients using a
CompletableFuture mechanism.
server-endpoint| Constructor and Description |
|---|
HTTPMockServerEndpointSource() |
| Modifier and Type | Method and Description |
|---|---|
void |
completeResponse(HTTPMockServerResponse response,
org.mule.runtime.extension.api.runtime.source.SourceCallbackContext callbackContext) |
void |
onStart(org.mule.runtime.extension.api.runtime.source.SourceCallback<InputStream,HTTPMockRequestAttributes> sourceCallback) |
void |
onStop() |
void |
onTerminate() |
public void onStart(org.mule.runtime.extension.api.runtime.source.SourceCallback<InputStream,HTTPMockRequestAttributes> sourceCallback) throws org.mule.runtime.api.exception.MuleException
onStart in class org.mule.runtime.extension.api.runtime.source.Source<InputStream,HTTPMockRequestAttributes>org.mule.runtime.api.exception.MuleExceptionpublic void onStop()
onStop in class org.mule.runtime.extension.api.runtime.source.Source<InputStream,HTTPMockRequestAttributes>@OnTerminate public void onTerminate()
@OnSuccess
public void completeResponse(@ParameterGroup(name="response",showInDsl=true)
HTTPMockServerResponse response,
org.mule.runtime.extension.api.runtime.source.SourceCallbackContext callbackContext)
Copyright © 2025 MuleSoft, Inc.. All rights reserved.