Attribute attrib = new DefaultAttribute( SchemaConstants.SN_AT, SN_AT );
String attribVal = "Johnny";
attrib.add( attribVal );
Modification add = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, attrib );
Entry lookedup = store.fetch( store.getEntryId( dn ), dn );
assertEquals( "WAlkeR", lookedup.get( "sn" ).get().getString() ); // before replacing
lookedup = store.modify( dn, add );
assertEquals( attribVal, lookedup.get( "sn" ).get().getString() );
// testing the store.modify( dn, mod, entry ) API
Modification replace = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, SN_AT, "JWalker" );
lookedup = store.modify( dn, replace );
assertEquals( "JWalker", lookedup.get( "sn" ).get().getString() );
assertEquals( 1, lookedup.get( "sn" ).size() );
}