It seems this was a simple fix:

-        BeanInterface applicationScopedBean = mock(BeanInterface.class);
+        BeanInterface applicationScopedBean =
mock(ApplicationScopedBean.class);


On Thu, Apr 12, 2018 at 12:06 PM, Stephen More <stephen.m...@gmail.com>
wrote:

> I made a fork of:
>     https://github.com/os890/javase-cdi-ds-project-template/tree/mock-demo
> which can be found here:
>     https://github.com/mores/javase-cdi-ds-project-
> template/tree/mockingInterface
>
> When I run this test I get:
>    injectionTest(org.os890.cdi.test.SimpleMockTest):
> org.os890.cdi.template.BeanInterface$$EnhancerByMockitoWithCGLIB$$c23295e6
> isn't a supported approach for mocking -> please extend from the original
> class.
>
> What is the best way to inject a mocked interface with many methods ?
> Any help is appreciated.
>
> -Thanks
>

Reply via email to