- Version of JMockit that was used:
OpenJDK 1.8.0_232, JUnit 4.12, JMockit 1.48
- Description of the problem or enhancement request:
Below example JUnit code snippet fails with an java.lang.IllegalArgumentException
final List<String[]> commandArrays = new ArrayList<>();
new MockUp<ProcessBuilder>() {
@Mock
public ProcessBuilder command(Invocation inv, String... command) {
commandArrays.add(command);
inv.proceed((Object[])command);
}
};
new ProcessBuilder().command("echo", "'Some test'");
Result:
java.lang.IllegalArgumentException: Failure to invoke method: public java.lang.ProcessBuilder java.lang.ProcessBuilder.command(java.lang.String[])
Caused by: java.lang.IllegalArgumentException: argument type mismatch
While faking ProcessBuilder via MockUp is probably a bad idea and mocking should be used instead, is it an easy example to show this bug.
OpenJDK 1.8.0_232, JUnit 4.12, JMockit 1.48
Below example JUnit code snippet fails with an
java.lang.IllegalArgumentExceptionResult:
While faking
ProcessBuilderviaMockUpis probably a bad idea and mocking should be used instead, is it an easy example to show this bug.