custom-scope

BeanManager always returns same reference

拟墨画扇 提交于 2019-12-24 09:07:35
问题 I am creating a custom CDI scope and am using the BeanManager to get an injection of my NavigationHandler custom class. But the beans it returns are quite strange. So I use the BeanManager that way : public class ScreenContext implements Context { private NavigationHandler getNavigationHandler() { final Set<Bean<?>> beans = m_beanManager.getBeans(NavigationHandler.class); final Bean<?> bean = m_beanManager.resolve(beans); NavigationHandler reference = (NavigationHandler) m_beanManager

Espresso testing with Dagger 2 and custom scopes

拥有回忆 提交于 2019-12-08 02:05:43
问题 After a recent migration to Dagger 2, the app I am working on is using an @ActivityScope for every feature. Each app feature is implemented using MVP pattern and has it's own local dagger Component setup which depends on the Application component for the dependencies that are required during the entire app lifecycle (provided by the App). Each feature’s Activity extends a base class which provides the main application component to a method that is overridden by each activity in order to set

Espresso testing with Dagger 2 and custom scopes

拜拜、爱过 提交于 2019-12-06 11:23:07
After a recent migration to Dagger 2, the app I am working on is using an @ActivityScope for every feature. Each app feature is implemented using MVP pattern and has it's own local dagger Component setup which depends on the Application component for the dependencies that are required during the entire app lifecycle (provided by the App). Each feature’s Activity extends a base class which provides the main application component to a method that is overridden by each activity in order to set up the local dagger component (builds the local component and instantiates the local module). The issue