I am using Spring-Boot 2.5 and JUnit 5.
In a test class I have a bean (MyClass) that I need to inject some mocks and hence I use @InjectMocks.
@SpringBootTest
public class MyClassTest {
//@Autowired
@InjectMocks
private MyClass myClass;
@MockBean
private MyOtherClass myOtherClass;
...
}
Is the @Autowired annotation implicit/required in the example above (a @SpringBootTest)? What is the effect with or without it for the application context.