invokeAction("#{search.addToCart}");
}
@Override
protected void renderResponse() throws Exception {
ShoppingCart cart = (ShoppingCart) getValue("#{cart}");
assert cart != null;
assert cart.getCart().size() == 1;
}
}.run();
new FacesRequest("/dvd.xhtml", id) {
@Override
protected void beforeRequest() {
setParameter("id", "42");
}
}.run();
new FacesRequest("/dvd.xhtml", id) {
@Override
protected void invokeApplication() throws Exception {
invokeAction("#{search.addToCart}");
}
@Override
protected void renderResponse() throws Exception {
ShoppingCart cart = (ShoppingCart) getValue("#{cart}");
assert cart != null;
assert cart.getCart().size() == 2;
}
}.run();
new FacesRequest("/dvd.xhtml", id) {
@Override
protected void beforeRequest() {
setParameter("id", "41");
}
}.run();
new FacesRequest("/dvd.xhtml", id) {
@Override
protected void invokeApplication() throws Exception {
invokeAction("#{search.addToCart}");
}
@Override
protected void renderResponse() throws Exception {
ShoppingCart cart = (ShoppingCart) getValue("#{cart}");
assert cart != null;
assert cart.getCart().size() == 2;
}
}.run();
new FacesRequest("/dvd.xhtml", id) {
@Override
protected void beforeRequest() {
setParameter("id", "43");
}
}.run();
new FacesRequest("/dvd.xhtml", id) {
@Override
protected void invokeApplication() throws Exception {
invokeAction("#{search.addToCart}");
}
@Override
protected void renderResponse() throws Exception {
ShoppingCart cart = (ShoppingCart) getValue("#{cart}");
assert cart != null;
assert cart.getCart().size() == 3;
}
}.run();
}