Created
September 16, 2014 18:53
-
-
Save danhyun/88cd64a4bcc8c09d5765 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def "controller processes request"() { | |
| given: | |
| MockHttpServletRequest request = new MockHttpServletRequest() | |
| Customer customer = Mock(Customer) | |
| Order cart = Mock(Order) | |
| BroadleafRequestContext context = new BroadleafRequestContext() | |
| request.setAttribute(CustomerStateRequestProcessor.customerRequestAttributeName, customer) | |
| request.setAttribute(CartStateRequestProcessor.cartRequestAttributeName, cart) | |
| MockHttpServletResponse response = new MockHttpServletResponse() | |
| Model model = Mock(Model) | |
| context.request = request | |
| context.response = response | |
| BroadleafRequestContext.broadleafRequestContext = context | |
| BindingResult result = Mock(BindingResult) | |
| when: | |
| String view = String view = checkoutController.saveSingleShip(request, response, model, shippingInfoForm, result) | |
| then: | |
| response.status == 200 | |
| view == "/checkout" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment