Given this really simple Wicket component:
public class ProductImage extends WebComponent {
public ProductImage(String id, Product p) {
super(id, new Model(p));
add(new AttributeModifier("src", true, new Model(p.getImage())));
}
}
How to unit test it using WicketTester? Do I need a page?
In Wicket 1.5 there is #startComponentInPage(Component) which will create a page for you so you can test any kind of component.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With