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 Details

    • HttpClient

      public HttpClient()
      Default constructor initializing endpoint configuration.
    • HttpClient

      public HttpClient(HttpEndpointConfiguration endpointConfiguration)
      Default constructor using endpoint configuration.
      Parameters:
      endpointConfiguration -
  • Method Details

    • getEndpointConfiguration

      public HttpEndpointConfiguration getEndpointConfiguration()
      Specified by:
      getEndpointConfiguration in interface Endpoint
      Overrides:
      getEndpointConfiguration in class AbstractEndpoint
    • send

      public void send(Message message, TestContext context)
      Specified by:
      send in interface org.citrusframework.messaging.Producer
    • receive

      public Message receive(TestContext context)
      Specified by:
      receive in interface org.citrusframework.messaging.Consumer
    • receive

      public Message receive(String selector, TestContext context)
      Specified by:
      receive in interface org.citrusframework.messaging.SelectiveConsumer
    • receive

      public Message receive(TestContext context, long timeout)
      Specified by:
      receive in interface org.citrusframework.messaging.Consumer
    • receive

      public Message receive(String selector, TestContext context, long timeout)
      Specified by:
      receive in interface org.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:
      createProducer in interface Endpoint
    • createConsumer

      public org.citrusframework.messaging.SelectiveConsumer createConsumer()
      Creates a message consumer for this endpoint. Consumer receives messages on this endpoint.
      Specified by:
      createConsumer in interface Endpoint
      Returns:
    • setCorrelationManager

      public void setCorrelationManager(CorrelationManager<Message> correlationManager)
      Sets the correlation manager.
      Parameters:
      correlationManager -