public void doRenderMarkupCachedContentValidationNotExpiredMethodTest() throws PortletException, IOException, PortletContainerException {
MockHttpServletRequest request = new MockHttpServletRequest();
MockHttpServletResponse response = new MockHttpServletResponse();
TestingCacheState<CachedPortletData<PortletRenderResult>, PortletRenderResult> cacheState = new TestingCacheState<CachedPortletData<PortletRenderResult>, PortletRenderResult>();
cacheState.setUseCachedData(true);
CacheControl cacheControl = cacheState.getCacheControl();
cacheControl.setUseCachedContent(true);
cacheControl.setETag("123456");
cacheControl.setExpirationTime(300);
final PortletRenderResult portletResult = new PortletRenderResult("title", null, 0, 100);
final String output = "<p>Some content</p>";
CachedPortletData<PortletRenderResult> cachedPortletData = new CachedPortletData<PortletRenderResult>(
portletResult, output, null, null, false, cacheControl.getETag(), cacheControl.getExpirationTime());
cacheState.setCachedPortletData(cachedPortletData);
setupPortletExecutionMocks(request);
when(portletCacheControlService.getPortletRenderState(request, portletWindowId)).thenReturn(cacheState);
when(portalRequestInfo.getTargetedPortletWindowId()).thenReturn(portletWindowId);