Regarding Spring's @Autowired and Wicket's @SpringBean

Viewed 3711

I am currently looking into integrating Mockito and JUnit into my Wicket/Spring/Hibernate project and have found a tutorial on how to do this using annotations.

Trouble is I am unfamiliar with @Autowired and after a look on google I am finding it hard to see the difference between this annotation and the @SpringBean annotation.

Are they one in the same or is there a difference I should be aware of ?

My code to offer some context to this question:

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:applicationContext.xml"})
@TransactionConfiguration(transactionManager = "txManager", defaultRollback = false) 
public class TestHome
{
private WicketTester tester;

@Autowired
private ApplicationContext ctx;

@Autowired
private WebApplication webApplication;

@Before
public void setUp() {
    tester = new WicketTester(webApplication);
}

@Test
@Transactional
@Rollback(true)
public void testRenderHomePage() {
    tester.startPage(Home.class);
    tester.assertRenderedPage(Home.class);
    tester.assertComponent("home", Home.class);
}

}
1 Answers
Related