public static void startPluginContainer() throws Exception {
LOG.info("Setting up plugin container");
File pluginDir = new File("target/itest/plugins");
copyAdditionalPlugins(pluginDir);
PluginContainerConfiguration containerConfig = new PluginContainerConfiguration();
containerConfig.setPluginFinder(new FileSystemPluginFinder(pluginDir));
containerConfig.setPluginDirectory(pluginDir);
containerConfig.setInsideAgent(false);
// JMX plugin has resources which can only be manually added so we have to mock server integration.
DiscoveryServerService discoveryServerService = Mockito.mock(DiscoveryServerService.class);
when(discoveryServerService.addResource(any(Resource.class), anyInt())).thenAnswer(