What is the best practice in order to get an instance of the class to be tested in the test class?
Is it better to instantiate it manually with a
ClassToBeTested classToBeTested = new ClassToBeTested();
inside the test-class
OR
get it from the Spring context, like this:
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"/services-test-config.xml"})
public class MySericeTest {
@Autowired
MyService service;
...
}