I have the following code:
verify(javaCompiler, times(1)).writeJavaAndCompile(any(ContractCompilationUnit.class), eq(outputDirectory));
verify(javaCompiler, times(1)).writeJavaAndCompile(any(ParamCompilationUnit.class), eq(outputDirectory));
and my code is as follows:
javaCompiler.writeJavaAndCompile(new ContractCompilationUnit(), outputDirectory);
javaCompiler.writeJavaAndCompile(new ParamCompilationUnit(), outputDirectory);
The code does not work, because apparently the 1st check shows that there javaCompiler.writeJavaAndCompile()were 2 calls. He does not understand that there is only one type type call ContractCompilationUnit.
What is the standard procedure to avoid this behavior (besides the need to write your own interlocutor)?
source
share