Skip to content

[JUnit 5] Without a Video Annotation, a Video will never be recorded #70

@mseele

Description

@mseele

com.automation.remarks.junit5.VideoExtension.videoDisabled(...) will never return true if no Video Annotation is set:

private boolean videoDisabled(Method testMethod) {
   Optional<com.automation.remarks.video.annotations.Video> video = AnnotationUtils.findAnnotation(testMethod, com.automation.remarks.video.annotations.Video.class);

   return video.map(v -> !videoEnabled(v))
           .orElseGet(() -> true);

   //return !video.isPresent() && !videoEnabled(video.get());
 }

video.map will always return false if video is not given (javadoc of map: the mapping function to apply to a value, if present). So videoEnabled is never called without an annotation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions