jeudi 2 juillet 2020

junit 5 spring test without autowired annotation

Is it possible in junit 5 to inject spring beans into test class without Autowired annotation? My code look like this:

@SpringBootTest(classes = SomeApp.class)
@ExtendWith(SpringExtension.class)
public class SomeTest {
    @Autowired
    private SomeService someService

    @Test
    public void shouldMakeMagic() { ....

and i would like to remove all @Autowired annotations

Aucun commentaire:

Enregistrer un commentaire