ChorusHandlerJmxExporter implements ChorusHandlerJmxExporterMBean { public List<JmxInvokerResult> getStepInvokers() { List<JmxInvokerResult> invokers = new ArrayList<>(); for ( StepInvoker s : stepInvokers.values() ) { JmxInvokerResult jmxInvoker = new JmxInvokerResult(s); invokers.add(jmxInvoker); } return invokers; } ChorusHandlerJmxExporter(Object... handlers);  ChorusHandlerJmxExporter(UnaryOperator<Pattern> patternPreProcessor, Object... handlers); ChorusHandlerJmxExporter export(); JmxStepResult invokeStep(String stepInvokerId, String stepTokenId, Map chorusContext, List<String> args); @Override JmxStepFailureDiagnosticResult sendStepFailureDiagnostics(String stepTokenId, JmxStepFailureDiagnosticParams parameters); @Override BigDecimal getApiVersion(); List<JmxInvokerResult> getStepInvokers(); static final String JMX_EXPORTER_NAME; static final String JMX_EXPORTER_ENABLED_PROPERTY; }
@Test public void canExtractStepHandlersFromAStepInvokerProvider() { StepInvoker mockStepInvoker = mock(StepInvoker.class); when(mockStepInvoker.getStepPattern()).thenReturn(Pattern.compile(EXPECTED_PATTERN)); when(mockStepInvoker.getRetry()).thenReturn(StepRetry.NO_RETRY); StepInvokerProvider mockStepInvokerProvider = mock(StepInvokerProvider.class); when(mockStepInvokerProvider.getStepInvokers()).thenReturn(Arrays.asList(mockStepInvoker)); ChorusHandlerJmxExporter chorusHandlerJmxExporter = new ChorusHandlerJmxExporter(mockStepInvokerProvider); List<JmxInvokerResult> jmxInvokerResults = chorusHandlerJmxExporter.getStepInvokers(); assertEquals(1, jmxInvokerResults.size()); String stepPattern = (String)jmxInvokerResults.get(0).get(JmxInvokerResult.PATTERN); assertEquals(EXPECTED_PATTERN, stepPattern); }