Class MockTransportService

All Implemented Interfaces:
Closeable, AutoCloseable, LifecycleComponent, org.elasticsearch.core.Releasable, ReportingService<TransportInfo>, TransportConnectionListener, TransportMessageListener

public class MockTransportService extends TransportService
A mock delegate service that allows to simulate different network topology failures. Internally it maps TransportAddress objects to rules that inject failures. Adding rules for a node is done by adding rules for all bound addresses of a node (and the publish address, if different). Matching requests to rules is based on the delegate address associated with the discovery node of the request, namely by DiscoveryNode.getAddress(). This address is usually the publish address of the node but can also be a different one (for example, @see org.elasticsearch.discovery.HandshakingTransportAddressConnector, which constructs fake DiscoveryNode instances where the publish address is one of the bound addresses).