@Test public void should_create_video_from_root_directory() throws NoSuchMethodException { TakeVncDroneVideo takeVncDroneVideo = new TakeVncDroneVideo(); takeVncDroneVideo.reportEvent = reportEvent; final Method method = getMethod("should_create_video_from_root_directory"); AfterVideoRecorded afterVideoRecorded = new AfterVideoRecorded(new After(TakeDockerEnvironmentTest.class, method), Paths.get("target/myvideo.flv")); takeVncDroneVideo.reportScreencastRecording(afterVideoRecorded, getReporterConfiguration()); verify(reportEvent).fire(reportEventArgumentCaptor.capture()); final SectionEvent sectionEvent = reportEventArgumentCaptor.getValue(); final String methodName = method.getName(); assertThatSection(sectionEvent) .hasSectionId(methodName) .hasReportOfTypeThatIsAssignableFrom(TestMethodReport.class); final Report report = sectionEvent.getReport(); assertThatReport(report) .hasName(methodName) .hasNumberOfEntries(1) .hasEntriesContaining(new KeyValueEntry(DockerEnvironmentReportKey.VIDEO_PATH, new FileEntry("myvideo.mp4"))); }
public void reportScreencastRecording(@Observes AfterVideoRecorded event, ReporterConfiguration reporterConfiguration) { Path videoLocation = event.getVideoLocation(); if (videoLocation != null) { videoLocation = Paths.get(videoLocation.toString().replace("flv", "mp4")); final Path rootDir = Paths.get(reporterConfiguration.getRootDirectory()); final Path relativize = rootDir.relativize(videoLocation); final Method testMethod = getTestMethod(event); Reporter.createReport(new TestMethodReport(testMethod.getName())) .addKeyValueEntry(DockerEnvironmentReportKey.VIDEO_PATH, new FileEntry(relativize)) .inSection(new TestMethodSection(testMethod)) .fire(reportEvent); } }
TakeVncDroneVideo { public void reportScreencastRecording(@Observes AfterVideoRecorded event, ReporterConfiguration reporterConfiguration) { Path videoLocation = event.getVideoLocation(); if (videoLocation != null) { videoLocation = Paths.get(videoLocation.toString().replace("flv", "mp4")); final Path rootDir = Paths.get(reporterConfiguration.getRootDirectory()); final Path relativize = rootDir.relativize(videoLocation); final Method testMethod = getTestMethod(event); Reporter.createReport(new TestMethodReport(testMethod.getName())) .addKeyValueEntry(DockerEnvironmentReportKey.VIDEO_PATH, new FileEntry(relativize)) .inSection(new TestMethodSection(testMethod)) .fire(reportEvent); } } }
TakeVncDroneVideo { public void reportScreencastRecording(@Observes AfterVideoRecorded event, ReporterConfiguration reporterConfiguration) { Path videoLocation = event.getVideoLocation(); if (videoLocation != null) { videoLocation = Paths.get(videoLocation.toString().replace("flv", "mp4")); final Path rootDir = Paths.get(reporterConfiguration.getRootDirectory()); final Path relativize = rootDir.relativize(videoLocation); final Method testMethod = getTestMethod(event); Reporter.createReport(new TestMethodReport(testMethod.getName())) .addKeyValueEntry(DockerEnvironmentReportKey.VIDEO_PATH, new FileEntry(relativize)) .inSection(new TestMethodSection(testMethod)) .fire(reportEvent); } }  }
TakeVncDroneVideo { public void reportScreencastRecording(@Observes AfterVideoRecorded event, ReporterConfiguration reporterConfiguration) { Path videoLocation = event.getVideoLocation(); if (videoLocation != null) { videoLocation = Paths.get(videoLocation.toString().replace("flv", "mp4")); final Path rootDir = Paths.get(reporterConfiguration.getRootDirectory()); final Path relativize = rootDir.relativize(videoLocation); final Method testMethod = getTestMethod(event); Reporter.createReport(new TestMethodReport(testMethod.getName())) .addKeyValueEntry(DockerEnvironmentReportKey.VIDEO_PATH, new FileEntry(relativize)) .inSection(new TestMethodSection(testMethod)) .fire(reportEvent); } }  void reportScreencastRecording(@Observes AfterVideoRecorded event, ReporterConfiguration reporterConfiguration); }
TakeVncDroneVideo { public void reportScreencastRecording(@Observes AfterVideoRecorded event, ReporterConfiguration reporterConfiguration) { Path videoLocation = event.getVideoLocation(); if (videoLocation != null) { videoLocation = Paths.get(videoLocation.toString().replace("flv", "mp4")); final Path rootDir = Paths.get(reporterConfiguration.getRootDirectory()); final Path relativize = rootDir.relativize(videoLocation); final Method testMethod = getTestMethod(event); Reporter.createReport(new TestMethodReport(testMethod.getName())) .addKeyValueEntry(DockerEnvironmentReportKey.VIDEO_PATH, new FileEntry(relativize)) .inSection(new TestMethodSection(testMethod)) .fire(reportEvent); } }  void reportScreencastRecording(@Observes AfterVideoRecorded event, ReporterConfiguration reporterConfiguration);  }