@Test
public void testHasPermission() throws Exception {

    Session delegate = mock(Session.class);
    SessionFacade<Session> facade = getFacade(delegate);
    when(delegate.hasPermission(anyString(), anyString())).thenReturn(false);
    when(delegate.hasPermission("/correct/path", Session.ACTION_READ)).thenReturn(true);
    assertFalse("should not have permission", facade.hasPermission("", ""));
    assertTrue("should have permission",
            facade.hasPermission("/correct/path", Session.ACTION_READ));
}