[MGNLWCS-103] ShoppingCartModel should set Cache-Control to no-cache Created: 06/Jan/15 Updated: 03/Mar/15 Resolved: 06/Feb/15 |
|
| Status: | Closed |
| Project: | Websphere Commerce Integration |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 1.0.5, 1.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Milan Divilek | Assignee: | AntonĂn Juran |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | quickwin | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Template: |
|
| Acceptance criteria: |
Empty
|
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
| Description |
|
Pages where shopping cart is displayed should not be cached. |
| Comments |
| Comment by Milan Divilek [ 06/Feb/15 ] |
|
Reopen: if (MgnlContext.isWebContext()) { MgnlContext.getWebContext().getResponse().setHeader("Cache-Control", "no-cache"); } 2. It's unnecessary to introduce mockrunner-servlet dependency. Test can be easily done with mockito. - MockHttpServletResponse response = new MockHttpServletResponse(); + HttpServletResponse response = mock(HttpServletResponse.class); - boolean beforeExecute = MgnlContext.getWebContext().getResponse().containsHeader("Cache-Control"); - boolean afterExecute = MgnlContext.getWebContext().getResponse().containsHeader("Cache-Control"); - assertFalse(beforeExecute); - assertTrue(afterExecute); + verify(response).setHeader("Cache-Control", "no-cache"); |