Hi guys,

I am prototyping a bean mocking feature for the test-module.

The basic idea is to have an @MockBean annotation that is an @Alternative 
@Stereotype and is enabled by the test module.

The basic features works nearly out of the box (see 
https://github.com/ArneLimburg/openwebbeans-meecrowave-examples/blob/mock/junit5-mock/src/test/java/com/superbiz/jaxrs/HelloEndpointTest.java).

The drawback of this small solution is, that the @MockBean has to be static and 
that we cannot have the same @MockBean definied in two tests (haven't tested 
that, but I guess we would have an AmbiguousResolutionException in that case).


So here is what I would like to do:

- Introduce a @TestClassScoped and @TestMethodScoped and make @MockBean 
@TestMethodScoped

- Make every test class a CDI bean such that @Produces @MockBean fields are 
collected (Does anyone know why we don't did that in the first place)?

- Maybe (in a next step) directly add support for Mockito mocks or otherwise be 
sure, that our extension plays well together with the MockitoExtension


Any objections to go ahead with that?


I have no Idea how this could work with the @MonoMeecrowaveConfig.


Any ideas on that?


Cheers,

Arne

OPEN KNOWLEDGE GmbH
Poststraße 1, 26122 Oldenburg
Mobil: +49 151 - 108 22 942
Tel: +49 441 - 4082-154
Fax: +49 441 - 4082-111
arne.limb...@openknowledge.de
www.openknowledge.de <https://www.openknowledge.de/>

Registergericht: Amtsgericht Oldenburg, HRB 4670
Geschäftsführer: Lars Röwekamp, Jens Schumann

Treffen Sie uns auf kommenden Konferenzen und Workshops:

Zu unseren Events<https://www.openknowledge.de/event/>




Reply via email to