Open averbraeck opened 1 year ago
An example of the problem is that Gtu
is now a class, with a final getSimulator()
implementation, instead of an interface with a public getSimulator()
definition. In order for Mockito to mock this method, add a file called mockito-extensions to /src/test/resources of the projects with this problem, with one line:
mock-maker-inline
and update the Mockito version to 5.x.
In OdAppliertest
in ots-core, the test public void gtuFractionTest()
does not work, and stops with a NullPointerException
. I do not understand enough of the OdApplier
to repair the test. @WJSchakel : can you take a look (it's not urgent).
@averbraeck the test was missing characteristics generators, which are no longer given by default in OdOptions
as they rely on default GTU types etc. The test is fixed now.
And now the @Test is also uncommented (it got commented after I merged changes before committing).
Thanks! It works. All other issues also tackled (although there are still quite a few tests of which parts were already commented out). New version of OTS will be released this afternoon.
When running unit tests on OTS, there are many failures. Some of the
mock()
methods with Mockito don't work (e.g., because they mock a final method). Also, unit tests fail because the 'contract' of the methods has changed.