DefaultSessionFacade implements SessionFacade { @Override public SessionResource getCurrentSession() { Session session = sessionService.getSession(); SessionResource resource = entityConverter.convert(session); LOG.info("Exposing session details: {}", resource); return resource; }  @Override SessionResource getCurrentSession();  }
@Test public void testGetCurrentSession() throws Exception { String login = "login"; User user = new User(); user.setLogin(login); Session session = new Session(); session.setUser(user); session.setGroups(Collections.<Group>emptyList()); session.setRoles(Collections.<Role>emptyList()); SessionResource expected = new SessionResource(); expected.setLogin(login); expected.setGroups(Collections.<String>emptyList()); expected.setRoles(Collections.<String>emptyList()); when(sessionService.getSession()).thenReturn(session); when(entityConverter.convert(any(Session.class))).thenReturn(expected); SessionResource actual = unit.getCurrentSession(); verify(sessionService).getSession(); verify(entityConverter).convert(session); assertEquals(expected, actual); }