server.registerMBean(EasyMock.anyObject(), EasyMock.isA(ObjectName.class));
EasyMock.expectLastCall().andReturn(new ObjectInstance(new ObjectName(exporter.getBeanKeyForJobExecution("foo")), SimpleJobExecutionMetrics.class.getName()));
server.registerMBean(EasyMock.anyObject(), EasyMock.isA(ObjectName.class));
EasyMock.expectLastCall().andReturn(new ObjectInstance(new ObjectName(exporter.getBeanKeyForStepExecution("foo", "step")), SimpleStepExecutionMetrics.class.getName()));
JobService jobService = EasyMock.createNiceMock(JobService.class);
exporter.setJobService(jobService);
jobService.listJobs(0, Integer.MAX_VALUE);
EasyMock.expectLastCall().andReturn(Arrays.asList("foo")).anyTimes();
jobService.listJobExecutionsForJob("foo", 0, 1);
EasyMock.expectLastCall().andReturn(Arrays.asList(MetaDataInstanceFactory.createJobExecutionWithStepExecutions(123L, Arrays.asList("step")))).anyTimes();
EasyMock.replay(server, jobService);
exporter.doStart();