when(servletRequest.getHttpServletRequest()).thenReturn(httpServletRequest);
HttpSession session = mock(HttpSession.class);
when(httpServletRequest.getSession()).thenReturn(session);</BUG>
ServletContext servletContext = mock(ServletContext.class);
<BUG>when(session.getServletContext()).thenReturn(servletContext);
</BUG>
when(servletContext.getServerInfo()).thenReturn("Apache Tomcat/7.0.4 (optional text)");
assertEquals("{\"servletContainerVersion\":\"7.0.4\",\"servletContainerName\":\"Apache Tomcat\"}",
JSONObject.fromObject(this.mocker.getComponentUnderTest().provideData()).toString());
}

JSONObject.fromObject(this.mocker.getComponentUnderTest().provideMapping()).toString()
);
}
@Test
public void provideData() throws Exception
{
ServletEnvironment servletEnvironment = mock(ServletEnvironment.class);
ReflectionUtils.setFieldValue(this.mocker.getComponentUnderTest(), "environment", servletEnvironment);
ServletContext servletContext = mock(ServletContext.class);
when(servletEnvironment.getServletContext()).thenReturn(servletContext);
when(servletContext.getServerInfo()).thenReturn("Apache Tomcat/7.0.4 (optional text)");
assertEquals("{\"servletContainerVersion\":\"7.0.4\",\"servletContainerName\":\"Apache Tomcat\"}",
JSONObject.fromObject(this.mocker.getComponentUnderTest().provideData()).toString());
