@Test void shouldNotFailIfNoResultsDirectory(@TempDir final Path folder) { Path resolve = folder.resolve("some-directory"); FileSystemResultsWriter writer = new FileSystemResultsWriter(resolve); final TestResult testResult = current().nextObject(TestResult.class, "steps"); writer.write(testResult); }
@Override public void write(final TestResult testResult) { final String testResultName = Objects.isNull(testResult.getUuid()) ? generateTestResultName() : generateTestResultName(testResult.getUuid()); createDirectories(outputDirectory); final Path file = outputDirectory.resolve(testResultName); try { mapper.writeValue(file.toFile(), testResult); } catch (IOException e) { throw new AllureResultsWriteException("Could not write Allure test result", e); } }
FileSystemResultsWriter implements AllureResultsWriter { @Override public void write(final TestResult testResult) { final String testResultName = Objects.isNull(testResult.getUuid()) ? generateTestResultName() : generateTestResultName(testResult.getUuid()); createDirectories(outputDirectory); final Path file = outputDirectory.resolve(testResultName); try { mapper.writeValue(file.toFile(), testResult); } catch (IOException e) { throw new AllureResultsWriteException("Could not write Allure test result", e); } } }
FileSystemResultsWriter implements AllureResultsWriter { @Override public void write(final TestResult testResult) { final String testResultName = Objects.isNull(testResult.getUuid()) ? generateTestResultName() : generateTestResultName(testResult.getUuid()); createDirectories(outputDirectory); final Path file = outputDirectory.resolve(testResultName); try { mapper.writeValue(file.toFile(), testResult); } catch (IOException e) { throw new AllureResultsWriteException("Could not write Allure test result", e); } } FileSystemResultsWriter(final Path outputDirectory); }
FileSystemResultsWriter implements AllureResultsWriter { @Override public void write(final TestResult testResult) { final String testResultName = Objects.isNull(testResult.getUuid()) ? generateTestResultName() : generateTestResultName(testResult.getUuid()); createDirectories(outputDirectory); final Path file = outputDirectory.resolve(testResultName); try { mapper.writeValue(file.toFile(), testResult); } catch (IOException e) { throw new AllureResultsWriteException("Could not write Allure test result", e); } } FileSystemResultsWriter(final Path outputDirectory); @Override void write(final TestResult testResult); @Override void write(final TestResultContainer testResultContainer); @Override void write(final String source, final InputStream attachment); }
FileSystemResultsWriter implements AllureResultsWriter { @Override public void write(final TestResult testResult) { final String testResultName = Objects.isNull(testResult.getUuid()) ? generateTestResultName() : generateTestResultName(testResult.getUuid()); createDirectories(outputDirectory); final Path file = outputDirectory.resolve(testResultName); try { mapper.writeValue(file.toFile(), testResult); } catch (IOException e) { throw new AllureResultsWriteException("Could not write Allure test result", e); } } FileSystemResultsWriter(final Path outputDirectory); @Override void write(final TestResult testResult); @Override void write(final TestResultContainer testResultContainer); @Override void write(final String source, final InputStream attachment);  }