Hello dear people,
I have a question about diffblue cover with spring boot framework. When I want to generate unit tests for my service layer (annotated with @Service) with Diffblue Cover, it detects the framework behind it, and notices it is about Spring, then it uses spring test context to write tests. Is there any way by forcing Diffblue Cover to use only JUNIT5+Mockito (Somehow in the settings in IntelliJ). Specifically:
@ExtendWith(MockitoExtension.class)
class XServiceTest {
@Mock private XRepository xRepository;
@Mock private YRepository yRepository;
@InjectMocks
private XService xService;
.....
@Test
....
intead of:
@ContextConfiguration(classes = XService.class})
@ExtendWith(SpringExtension.class)
class XServiceTest {
@MockBean private XRepository xRepository;
@MockBean private YRepository yRepository;
@Autowired
private XService xService;
.....
@Test
....
At the moment I do that manually.
Thanks for your answers