You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to set up Karibu-Testing 1.2.12 with a Vaadin 14.5.2/CDI project. Using the hints given in #60, I was able to create an initial setup, but I am now stuck with the error No org.apache.deltaspike.core.api.provider.BeanManagerProvider in place! Please ensure that you configured the CDI implementation of your choice properly. If your setup is correct, please clear all caches and compiled artifacts.
which can be traced back to AbstractCdiInstantiiator#getOrCreate calling BeanProvider.injectFields(instance);.
Who is supposed to provide the BeanManager? Vaadin-CDI addon or my project?
The weld-junit5 dependency seems to provide weld-se-core/weld-core-impl, so there is a CDI container available. Do I need to configure it somewhere?
What else am I supposed to configure?
publicclassCdiMockServiceextendsMockService {
privatefinalWeldInitiator_weld;
publicCdiMockService(finalWeldInitiatorweld, @NotNullfinalVaadinServletservlet,
@NotNullfinalDeploymentConfigurationdeploymentConfiguration) {
super(servlet, deploymentConfiguration, MockedUI::new);
_weld = weld;
//TODO is that needed? What should the SessionListener do? addSessionInitListener(new SessionListener());
}
@OverrideprotectedInstantiatorcreateInstantiator() throwsServiceException {
finalBeanManagerbeanManager = _weld.getBeanManager();
returnnewKaribuVaadinCDIInstantiator(this, beanManager);
}
}
provide KaribuVaadinCDIInstantiator. Route not found issue #60 also does not include this class so here is my attempt, inheriting from Vaadin AbstractCdiInstantiator
I'm sorry but I haven't been using CDI for a long time. There's https://github.com/mvysny/vaadin-quarkus-skeleton-starter which uses Quarkus CDI implementation which is then able to look up the BeanManager, but only if the test is annotated with @QuarkusTest.
I am trying to set up Karibu-Testing 1.2.12 with a Vaadin 14.5.2/CDI project. Using the hints given in #60, I was able to create an initial setup, but I am now stuck with the error
No org.apache.deltaspike.core.api.provider.BeanManagerProvider in place! Please ensure that you configured the CDI implementation of your choice properly. If your setup is correct, please clear all caches and compiled artifacts.
which can be traced back to
AbstractCdiInstantiiator#getOrCreate
callingBeanProvider.injectFields(instance);
.Who is supposed to provide the
BeanManager
? Vaadin-CDI addon or my project?The
weld-junit5
dependency seems to provide weld-se-core/weld-core-impl, so there is a CDI container available. Do I need to configure it somewhere?What else am I supposed to configure?
What I did so far:
testImplementation
dependencies forprovide an empty
beans.xml
insrc/test/resources/META-INF/
(not sure whether required in this context).implement JUnit 5 Test Class with Weld
http://weld.cdi-spec.org/news/2017/12/19/weld-meets-junit5/
WeldMockVaadinServlet
(taken from Route not found issue #60):CdiMockService
is also taken from Route not found issue #60KaribuVaadinCDIInstantiator
. Route not found issue #60 also does not include this class so here is my attempt, inheriting from VaadinAbstractCdiInstantiator
SessionListener
, do I need to provide one? What should it do?The text was updated successfully, but these errors were encountered: