Eric,

All of our data providers use an external source to load the actual data,
e.g. a repository or dao.

As all of our repositories and daos are interfaces, those are easy to mock.


Testing the provider is then simply a matter of ensuring the right methods,
with the right parameters are called on the mocked objects.


What functionality in your (custom) data providers do you have that you
want to test? In general I would say that final methods in a known and
tested library (wicket) do not need to be tested anyway - that is the
responsibility of the library.

Met vriendelijke groet,
Kind regards,

Bas Gooren

Op 12 januari 2017 bij 10:23:12, Eric J. Van der Velden (
ericjvandervel...@gmail.com) schreef:

Hello,

SortableDataProvider, in
package org.apache.wicket.extensions.markup.html.repeater.util, has a final
method getSortState().

I cannot mock this method.

I have copied SortableDataProvider under a different name, and subclassed
this one,but I do not like this.

The same happens with final LoadableDetachableModel.getObject(), but in
this case I could mock LoadableDetachableModel.load().

So why are these methods final, and how do programmers test the provider?

Thank you!

Reply via email to