How to Inject Prototype bean in Mockito

Viewed 2205

I am using InjectMocks and Spy annotations for injecting a prototype bean.

However the inject bean behaves like singleton bean. Is there any way to inject a prototype scoped bean in Mockito?

I am running JUnit with SpringJUnit4ClassRunner and init mocks using MockitoAnnotations.initMocks(this).

1 Answers
Related