Re: [Geoserver-devel] powermock for unit tests in app-schema

2021-03-23 Thread Niels Charlier via Geoserver-devel
Yes, I managed to get rid of powermock and use mockito this way. Thanks. As a side note though, you can't treat powermock as an alternative for those other two. Powermock is always used in combination with (and depending on) one of those two (you must use either powermock-easymock or powermock

Re: [Geoserver-devel] powermock for unit tests in app-schema

2021-03-09 Thread Andrea Aime
Another consideration... what is the "popularity" of the mocking libraries in the code? I made a very quick check (yes, debatable, I know): ~/devel/git-gt (main) $ git grep mockito | wc -l 114 ~/devel/git-gt (main) $ git grep easymock | wc -l 67 ~/devel/git-gt (main) $ git grep powermock | wc -l 2

Re: [Geoserver-devel] powermock for unit tests in app-schema

2021-03-09 Thread Andrea Aime
Hi all, chiming in... indeed Nuno's comment was not against unit testing with mocks (that's good per se), but about the proliferation of mock testing libraries: https://github.com/geotools/geotools/pull/3367#issuecomment-791476559 I also agree there are too many. By the way, just a note, wiremock

Re: [Geoserver-devel] powermock for unit tests in app-schema

2021-03-09 Thread Niels Charlier via Geoserver-devel
PowerMock is the only mocking library that can bypass a class being final. It actually serves a different purpose to these other frameworks because you must still use the API of one of the other ones (easymock, mockito,..) of your choice, but you get additional 'power'. The alternative would b

Re: [Geoserver-devel] powermock for unit tests in app-schema

2021-03-09 Thread Mark Prins
On 08-03-2021 13:01, Niels Charlier via Geoserver-devel wrote: Hello, I fixed a bug in geoserver app-schema (https://github.com/geotools/geotools/pull/3367 https://osgeo-org.atlassian.net/browse/GEOT-6801). The change I made was very small (one character actually) and in one specific class. T

[Geoserver-devel] powermock for unit tests in app-schema

2021-03-08 Thread Niels Charlier via Geoserver-devel
Hello, I fixed a bug in geoserver app-schema (https://github.com/geotools/geotools/pull/3367 https://osgeo-org.atlassian.net/browse/GEOT-6801). The change I made was very small (one character actually) and in one specific class. To me it seemed appropriate to write a unit test. Since it is JD