Package org.citrusframework.http.client
Class HttpClient
java.lang.Object
org.citrusframework.endpoint.AbstractEndpoint
org.citrusframework.http.client.HttpClient
- All Implemented Interfaces:
Named,Endpoint,org.citrusframework.messaging.Consumer,org.citrusframework.messaging.Producer,org.citrusframework.messaging.ReplyConsumer,org.citrusframework.messaging.SelectiveConsumer
public class HttpClient
extends AbstractEndpoint
implements org.citrusframework.messaging.Producer, org.citrusframework.messaging.ReplyConsumer
Http client sends messages via Http protocol to some Http server instance, defined by a request endpoint url. Synchronous response
messages are cached in local memory and receive operations are able to fetch responses from this cache later on.
- Since:
- 1.4
- Author:
- Christoph Deppisch
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor initializing endpoint configuration.HttpClient(HttpEndpointConfiguration endpointConfiguration) Default constructor using endpoint configuration. -
Method Summary
Modifier and TypeMethodDescriptionorg.citrusframework.messaging.SelectiveConsumerCreates a message consumer for this endpoint.org.citrusframework.messaging.ProducerCreates a message producer for this endpoint for sending messages to this endpoint.receive(String selector, TestContext context) receive(String selector, TestContext context, long timeout) receive(TestContext context) receive(TestContext context, long timeout) voidsend(Message message, TestContext context) voidsetCorrelationManager(CorrelationManager<Message> correlationManager) Sets the correlation manager.Methods inherited from class org.citrusframework.endpoint.AbstractEndpoint
getActor, getConsumerName, getName, getProducerName, setActor, setNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.citrusframework.messaging.Consumer
getNameMethods inherited from interface org.citrusframework.messaging.Producer
getName
-
Constructor Details
-
HttpClient
public HttpClient()Default constructor initializing endpoint configuration. -
HttpClient
Default constructor using endpoint configuration.- Parameters:
endpointConfiguration-
-
-
Method Details
-
getEndpointConfiguration
- Specified by:
getEndpointConfigurationin interfaceEndpoint- Overrides:
getEndpointConfigurationin classAbstractEndpoint
-
send
- Specified by:
sendin interfaceorg.citrusframework.messaging.Producer
-
receive
- Specified by:
receivein interfaceorg.citrusframework.messaging.Consumer
-
receive
- Specified by:
receivein interfaceorg.citrusframework.messaging.SelectiveConsumer
-
receive
- Specified by:
receivein interfaceorg.citrusframework.messaging.Consumer
-
receive
- Specified by:
receivein interfaceorg.citrusframework.messaging.SelectiveConsumer
-
createProducer
public org.citrusframework.messaging.Producer createProducer()Creates a message producer for this endpoint for sending messages to this endpoint.- Specified by:
createProducerin interfaceEndpoint
-
createConsumer
public org.citrusframework.messaging.SelectiveConsumer createConsumer()Creates a message consumer for this endpoint. Consumer receives messages on this endpoint.- Specified by:
createConsumerin interfaceEndpoint- Returns:
-
setCorrelationManager
Sets the correlation manager.- Parameters:
correlationManager-
-