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 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 Spring (e.g. 
>no need for persistence context initialization and Liquibase), but would 
>prefer to work with mocks. Is that enough information for you or what else 
>should I provide?
>Tom
>
>> Am 10.07.2019 um 11:00 schrieb Andrei Kondratev 
>> <andrei.kondra...@unimarket.com>:
>> 
>> 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, "Tom Götz" <t...@richmountain.de> wrote:
>>> 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
>>> Tom
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>> 
>> -- 
>> ANDREW KONDRATEV
>> TECHNICAL LEAD
>> 
>> 
>> 
>> MOB +64 210 492 674
>> EMAIL andrei.kondra...@unimarket.com
>> www.unimarket.com
>> 
>> Simple and easy-to-use software that brings all your procurement into one 
>> place.

Reply via email to