InventoryServiceIspn implements InventoryService { @Override public Optional<String> getJMXExporterConfig(String templateName) { return getConfig(templateName + "-jmx-exporter.yml"); } InventoryServiceIspn();   InventoryServiceIspn(Cache<String, Object> resource, Cache<String, Object> resourceType, String configPath, InventoryStatsMBean inventoryStatsMBean, ScrapeConfig scrapeConfig, File scrapeLocation); @Override void addResource(RawResource r); @Override void addResource(Collection<RawResource> resources); @Override void addResourceType(ResourceType rt); @Override void addResourceType(Collection<ResourceType> resourceTypes); @Override void deleteResources(Collection<String> ids); @Override void deleteAllResources(); @Override void deleteResourceTypes(Collection<String> typeIds); @Override void deleteAllTypes(); @Override Optional<Resource> getResourceById(String id); @Override Optional<ResourceNode> getTree(String parentId); @Override ResultSet<Resource> getResources(ResourceFilter filter, long startOffset, int maxResults); @Override ResultSet<Resource> getResources(ResourceFilter filter); @Override ResultSet<ResourceType> getResourceTypes(long startOffset, int maxResults); @Override ResultSet<ResourceType> getResourceTypes(); @Override Optional<ResourceType> getResourceType(String typeId); @Override Optional<String> getAgentConfig(String templateName); @Override Optional<String> getJMXExporterConfig(String templateName); @Override boolean isRunning(); @Override ResultSet<Resource> getChildren(String parentId); @Override ResultSet<Resource> getChildren(String parentId, long startOffset, int maxResults); @Override void buildExport(OutputStream os); @Override InventoryHealth getHealthStatus(); @Override void buildMetricsEndpoints();  }
@Test public void shouldNotGetJMXExporterConfig() { assertThat(service.getJMXExporterConfig("nada")).isNotPresent(); }
@Test public void shouldGetJMXExporterConfig() throws IOException { assertThat(service.getJMXExporterConfig("test")).isPresent() .hasValueSatisfying(s -> assertThat(s).contains("JMX EXPORTER TEST")); assertThat(service.getJMXExporterConfig("WF10")).isPresent() .hasValueSatisfying(s -> assertThat(s).contains("- pattern:")); }