Package org.elasticsearch.node
Class MockNode
java.lang.Object
org.elasticsearch.node.Node
org.elasticsearch.node.MockNode
- All Implemented Interfaces:
Closeable
,AutoCloseable
A node for testing which allows:
- Overriding Version.CURRENT
- Adding test plugins that exist on the classpath
- Swapping in various mock services
-
Field Summary
Fields inherited from class org.elasticsearch.node.Node
BREAKER_TYPE_KEY, INITIAL_STATE_TIMEOUT_SETTING, NODE_ATTRIBUTES, NODE_EXTERNAL_ID_SETTING, NODE_NAME_SETTING, WRITE_PORTS_FILE_SETTING
-
Constructor Summary
ConstructorDescriptionMockNode
(Settings settings, Collection<Class<? extends Plugin>> classpathPlugins) MockNode
(Settings settings, Collection<Class<? extends Plugin>> classpathPlugins, boolean forbidPrivateIndexSettings) MockNode
(Settings settings, Collection<Class<? extends Plugin>> classpathPlugins, Path configPath, boolean forbidPrivateIndexSettings) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
configureNodeAndClusterIdStateListener
(ClusterService clusterService) Collection<Class<? extends Plugin>>
The classpath plugins this node was constructed with.Methods inherited from class org.elasticsearch.node.Node
awaitClose, client, close, deleteTemporaryApmConfig, getEnvironment, getNodeEnvironment, getPluginsService, injector, isClosed, prepareForClose, settings, start, validateNodeBeforeAcceptingRequests
-
Constructor Details
-
MockNode
-
MockNode
public MockNode(Settings settings, Collection<Class<? extends Plugin>> classpathPlugins, boolean forbidPrivateIndexSettings) -
MockNode
public MockNode(Settings settings, Collection<Class<? extends Plugin>> classpathPlugins, Path configPath, boolean forbidPrivateIndexSettings)
-
-
Method Details
-
getClasspathPlugins
The classpath plugins this node was constructed with. -
configureNodeAndClusterIdStateListener
- Overrides:
configureNodeAndClusterIdStateListener
in classNode
-
getNamedWriteableRegistry
-