use of org.elasticsearch.env.NodeEnvironmentModule in project crate by crate.
the class SigarExtendedNodeInfoTest method prepare.
@Before
public void prepare() throws Exception {
NodeEnvironment nodeEnvironment = mock(NodeEnvironment.class);
when(nodeEnvironment.hasNodeFile()).thenReturn(true);
Path tempDir = createTempDir();
NodeEnvironment.NodePath[] dataLocations = new NodeEnvironment.NodePath[] { new NodeEnvironment.NodePath(tempDir, mock(Environment.class)) };
when(nodeEnvironment.nodePaths()).thenReturn(dataLocations);
NodeEnvironmentModule nodeEnvironmentModule = new NodeEnvironmentModule(nodeEnvironment);
MonitorModule monitorModule = new MonitorModule(NODE_SETTINGS);
monitorModule.addExtendedNodeInfoType(SigarPlugin.NODE_INFO_EXTENDED_TYPE, SigarExtendedNodeInfo.class);
Injector injector = new ModulesBuilder().add(new SettingsModule(NODE_SETTINGS), monitorModule, nodeEnvironmentModule, new SigarModule(new SigarService(NODE_SETTINGS))).createInjector();
extendedNodeInfo = injector.getInstance(ExtendedNodeInfo.class);
}
Aggregations