@Test
public void testGetCurrentSessionId() throws Exception {

  HttpSession session = createNiceMock(HttpSession.class);
  AmbariSessionManager sessionManager =
      createMockBuilder(AmbariSessionManager.class).addMockedMethod("getHttpSession").createMock();
  expect(sessionManager.getHttpSession()).andReturn(session);
  expect(sessionManager.getHttpSession()).andReturn(null);
  expect(session.getId()).andReturn("SESSION_ID").anyTimes();
  replay(session, sessionManager);
  assertEquals("SESSION_ID", sessionManager.getCurrentSessionId());
  assertNull(sessionManager.getCurrentSessionId());
  verify(session, sessionManager);
}