@Test
public void testRestrictedBy() throws Exception
{
Set<RestrictedByElem> rbItems = new HashSet<RestrictedByElem>();
rbItems.add( new RestrictedByElem( CN_AT, SN_AT ) );
Collection<ACITuple> tuples = getTuples( new RestrictedByItem( rbItems ) );
// Test wrong scope
AciContext aciContext = new AciContext( null, null );
aciContext.setAciTuples( tuples );
aciContext.setUserDn( USER_NAME );
aciContext.setAttributeType( CN_AT );
assertEquals( 0, filterA.filter( aciContext, OperationScope.ENTRY, null ).size() );
tuples = getTuples( new RestrictedByItem( rbItems ) );
aciContext = new AciContext( null, null );
aciContext.setAciTuples( tuples );
aciContext.setUserDn( USER_NAME );
aciContext.setAttributeType( CN_AT );
assertEquals( 0, filterA.filter( aciContext, OperationScope.ATTRIBUTE_TYPE, null ).size() );
tuples = getTuples( new RestrictedByItem( rbItems ) );
aciContext = new AciContext( null, null );
aciContext.setAciTuples( tuples );
aciContext.setUserDn( USER_NAME );
aciContext.setAttributeType( CN_AT );