I am confused about the class SpringRunner.
From Stackoverflow and google did understand that SpringRunner
and SpringJunit4ClassRunner
are one and the same.
@RunWith(SpringRunner.class)
My understanding of this class is :
- that as its name implies - it is a 'runner' ( it will run the Junit tests )
- This class is used while performing unit testing with the annotation
@RunWith
- This annotation helps in loading a spring application context and helps ‘autowire’ dependencies.
- This class should only be used if we need spring context bean dependencies.
- So this class should be used with caution otherwise we will unnecessarily load spring context during testing.
- This class helps Junit and Spring collaborate together.
With Junit5 and spring boot is this class no longer required ?
If yes what should we be using in a spring boot and Junit5 environment then ?