Skip to content

Commit

Permalink
Update unit test for ffprobe update version support
Browse files Browse the repository at this point in the history
  • Loading branch information
jeortizquan committed Aug 1, 2024
1 parent 7aaff8a commit 05d5e91
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ void testDiscoverFfprobeCommand() throws MediaProcessorException {
// ffprobe command
final String ffprobeCommand = "ffprobe";

// Test ffprobe 6
doReturn("ffprobe version 6.1.1-3ubuntu5 Copyright (c) 2007-2023 the FFmpeg developers")
.when(commandExecutor).execute(eq(Collections.singletonList(ffprobeCommand)), anyMap(), eq(true), any());
assertEquals(ffprobeCommand, AudioVideoProcessor.discoverFfprobeCommand(commandExecutor));

// Test ffprobe 4
doReturn("ffprobe version 4.4.4-0ubuntu0.18.04.1 Copyright (c) 2007-2018 the FFmpeg developers")
.when(commandExecutor).execute(eq(Collections.singletonList(ffprobeCommand)), anyMap(), eq(true), any());
Expand All @@ -109,7 +114,7 @@ void testDiscoverFfprobeCommand() throws MediaProcessorException {
.when(commandExecutor).execute(eq(Collections.singletonList(ffprobeCommand)), anyMap(), eq(true), any());
assertThrows(MediaProcessorException.class,
() -> AudioVideoProcessor.discoverFfprobeCommand(commandExecutor));
doReturn("ffprobe version 5.4.4-0ubuntu0.18.04.1 Copyright (c) 2007-2018 the FFmpeg developers")
doReturn("ffprobe version 7.4.4-0ubuntu0.18.04.1 Copyright (c) 2007-2018 the FFmpeg developers")
.when(commandExecutor).execute(eq(Collections.singletonList(ffprobeCommand)), anyMap(), eq(true), any());
assertThrows(MediaProcessorException.class,
() -> AudioVideoProcessor.discoverFfprobeCommand(commandExecutor));
Expand Down

0 comments on commit 05d5e91

Please sign in to comment.