@Test(expectedExceptions = { SecurityException.class })

public void accessDenied() {
    expect(backend.isRemoteAccessAllowed("localhost","127.0.0.1")).andReturn(false);
    replay(backend);
    handler.checkAccess("localhost", "127.0.0.1",null);
}