@Test
public void shouldCheckUserRoles() throws LDAPException {

    final HttpServletRequest mockRequest = mock(HttpServletRequest.class);
    final LDAPInterface ldap = someLdapInterfaceReturning("foo", "bar");
    final LdapRoleCheckingRequest request = new LdapRoleCheckingRequest(mockRequest, ldap, "uid=test", someLdapProperties());
    assertThat(request.isUserInRole("foo")).isEqualTo(true);
    assertThat(request.isUserInRole("foobar")).isEqualTo(false);
}