### Question:
CheckMKResultServiceImpl extends AbstractTeardownService implements ResultService { protected Path createSpoolFilePath(String dataId) { String spoolDir = checkMKProperties.getSpoolDir(); String fileName = new StringBuilder() .append(checkMKProperties.getFreshness()) .append(isEmpty(checkMKProperties.getSpoolFilePrefix()) ? "" : "_" + checkMKProperties.getSpoolFilePrefix() ) .append("_") .append(dataId) .toString(); return Paths.get(spoolDir + File.separator + fileName); }  @Override int getServicePriority(); @Override void tearDown(Optional<AbstractTestDataEntity> dataEntity, boolean asyncCall);  }### Answer:
@Test(dataProvider = "createSpoolFilePathDP") public void createSpoolFilePath(String spoolDir, String freshness, String spoolFileNamePrefix, String testSuiteName, String expectedFilePath) { doReturn(testSuiteName).when(testSuite).getId(); doReturn(spoolDir).when(checkMKProperties).getSpoolDir(); doReturn(freshness).when(checkMKProperties).getFreshness(); doReturn(spoolFileNamePrefix).when(checkMKProperties).getSpoolFilePrefix(); assertEquals(testling.createSpoolFilePath(testSuite.getId()).toString(), expectedFilePath); }