@Test
public void testWhenPostRequestChangedClientPortSessionIsValid() throws Exception {

  final String clientIp = "127.0.0.1:10000";
  final String sessionId = "111";
  final HttpServletRequest req = MockLoginAzkabanServlet
      .getRequestWithNoUpstream(clientIp, sessionId, "POST");
  final StringWriter writer = new StringWriter();
  final HttpServletResponse resp = getResponse(writer);
  final MockLoginAzkabanServlet servlet = MockLoginAzkabanServlet.getServletWithSession(sessionId,
      "user", "127.0.0.1");
  servlet.doPost(req, resp);
  // Assert that our response was written (we have a valid session)
  assertEquals("SUCCESS_MOCK_LOGIN_SERVLET", writer.toString());
}