In my Spring Boot test I'm using 2 mock beans with different qualifiers:
@RunWith(SpringRunner.class)
@SpringBootTest
class HohoTest {
@MockBean @Qualifier("haha") IHaha ahaha;
@MockBean @Qualifier("hoho") IHaha ohoho;
}
Since I'm not using these beans explicitly, I would rather move them away from the class body, as the @MockBean
annotation is now repeatable:
@RunWith(SpringRunner.class)
@SpringBootTest
@MockBean(IHaha.class)
@MockBean(IHaha.class)
class HohoTest {}
However, I need to pass in a qualifier as well, since they have the same type. Any idea on how I can achieve that?