### Question:
JMeterPostJob implements PostJob, CheckProject { public void executeOn(Project project, SensorContext context) { String jtlPath = settings.getString(JMeterPluginConst.LOCAL_JTL_PATH_PROPERTY); String config = settings.getString(JMeterPluginConst.CONFIG_PROPERTY); if (StringUtils.isNotBlank(jtlPath) || StringUtils.isNotBlank(config)) { return; } LOG.debug("START JMeterPostJob"); try { GlobalSummary summary = getGlobalSummaryFromLocalJTL(project); if(summary!=null) { JMeterMAO.saveSummaryAsMetrics(summary, context); } } catch (Exception e) { LOG.error("Cannot analyse project '" + project.getName() + "'", e); } LOG.debug("END JMeterPostJob"); } JMeterPostJob(Settings settings, FileSystem filesystem); boolean shouldExecuteOnProject(Project project); void executeOn(Project project, SensorContext context);  }### Answer:
@Test public void test() { FileSystem projectFileSystem = mock(FileSystem.class); File testProjectFolder = new File("src/test/resources/test-project"); doReturn(testProjectFolder).when(projectFileSystem).baseDir(); Project project = spy(new Project("JMeterPostJobTest","","JMeterPostJobTest")); JMeterPostJobForTesting job = new JMeterPostJobForTesting(projectFileSystem); job.executeOn(project, new MockSensorContext()); Assert.assertNotNull(job.getGlobalSummary()); }
@Test public void testNoJMeterMavenPluginJTL() { FileSystem projectFileSystem = mock(FileSystem.class); File testProjectFolder = new File("src/test/resources/notexistingfolder"); doReturn(testProjectFolder).when(projectFileSystem).baseDir(); Project project = spy(new Project("JMeterPostJobTest","","JMeterPostJobTest")); JMeterPostJobForTesting job = new JMeterPostJobForTesting(projectFileSystem); job.executeOn(project, new MockSensorContext()); Assert.assertNull(job.getGlobalSummary()); }