Not sure if it helps or it is what are you looking for but this is how I do
it.
I have abstract base class that
- sets Wicket application into Spring ApplicationContext
- creates WicketTester
- uses static configuration class to create mocks of required Spring
components in ApplicationContext
that
Have you tried @MockBean from Spring Boot. Alternative with
@ContextConfiguration you can assign configuration classes and export custom
mocks.
Stephan
Von meinem gesendet
Tom Götz schrieb
>We have both, a service layer and a persistence layer (each in it's own maven
>module).
We have both, a service layer and a persistence layer (each in it's own maven
module). We use Spring Data Jpa repositories for the persistence layer and
Liquibase for managing DB changes. When testing the Wicket layer I don't want
the complete persistence and service layer to be initialized by
Hi Tom!
It depends on the implementation. If you have a service level it's not
necessary to mock persistence, but enough to mock services and inject them
(if you use @Autowired annotation).
Could you please give a bit more examples of what you're trying to test?
On Wed, 10 Jul 2019 at 20:56,
Hi there,
we have a Spring Boot based webapp (Wicket 8.4 with wicket-spring-boot 2.1.6)
and would like to create a base test class for our Wicket tests. For testing,
we would like to mock the service and persistence layer (e.g. with Mockito). Is
there a good example for that purpose?
Cheers