File tree Expand file tree Collapse file tree
src/test/java/me/tamkungz/codecmedia Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212import static org .junit .jupiter .api .Assertions .assertEquals ;
1313import static org .junit .jupiter .api .Assertions .assertFalse ;
1414import static org .junit .jupiter .api .Assertions .assertNotNull ;
15+ import static org .junit .jupiter .api .Assertions .assertThrows ;
1516import static org .junit .jupiter .api .Assertions .assertTrue ;
1617import org .junit .jupiter .api .Test ;
1718import org .junit .jupiter .params .ParameterizedTest ;
@@ -84,6 +85,21 @@ void validate_shouldFailWhenFileMissing() throws Exception {
8485 assertTrue (result .errors ().stream ().anyMatch (e -> e .contains ("does not exist" )));
8586 }
8687
88+ @ Test
89+ void validate_shouldFailWhenInputIsNull () throws Exception {
90+ CodecMediaEngine engine = CodecMedia .createDefault ();
91+ var result = engine .validate (null , null );
92+ assertFalse (result .valid ());
93+ assertTrue (result .errors ().stream ().anyMatch (e -> e .contains ("Input file is required" )));
94+ }
95+
96+ @ Test
97+ void probe_shouldRejectNullInputPath () {
98+ CodecMediaEngine engine = CodecMedia .createDefault ();
99+ CodecMediaException ex = assertThrows (CodecMediaException .class , () -> engine .probe (null ));
100+ assertTrue (ex .getMessage ().contains ("Input file is required" ));
101+ }
102+
87103 @ Test
88104 void writeAndReadMetadata_shouldRoundTripViaSidecar () throws Exception {
89105 CodecMediaEngine engine = CodecMedia .createDefault ();
You can’t perform that action at this time.
0 commit comments