10. jUnit test
public class ExampleTest {
Example example;
@Before
public void setUp() {
example = new ExampleImpl();
}
@Test
public void testDoSomething() {
example.doSomething();
// verify ...
}
}
11. @Autowired
public class ExampleTest {
@Autowired
Example example;
@Test
public void testDoSomething() {
example.doSomething();
// verify ...
}
}