File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed
main/java/org/springframework/ldap/core
test/java/org/springframework/ldap/core Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ public Attribute put(Attribute attr) {
99
99
@ Override
100
100
public Attribute remove (String attrID ) {
101
101
Assert .hasLength (attrID , "Attribute ID must not be empty" );
102
- return attributes .remove (attrID );
102
+ return attributes .remove (attrID . toLowerCase () );
103
103
}
104
104
105
105
@ Override
Original file line number Diff line number Diff line change
1
+ package org .springframework .ldap .core ;
2
+
3
+ import org .junit .Test ;
4
+
5
+ import static org .assertj .core .api .Assertions .assertThat ;
6
+
7
+ public class NameAwareAttributesTest {
8
+ // gh-548
9
+ @ Test
10
+ public void removeWhenDifferentCaseThenRemoves () {
11
+ NameAwareAttributes attributes = new NameAwareAttributes ();
12
+ attributes .put ("myID" , "value" );
13
+ attributes .put ("myOtherID" , "othervalue" );
14
+ assertThat (attributes .size ()).isEqualTo (2 );
15
+ assertThat (attributes .get ("myid" ).get ()).isEqualTo ("value" );
16
+ assertThat (attributes .get ("myID" ).get ()).isEqualTo ("value" );
17
+
18
+ attributes .remove ("myid" );
19
+ assertThat (attributes .get ("myID" )).isNull ();
20
+ assertThat (attributes .size ()).isEqualTo (1 );
21
+
22
+ attributes .remove ("myOtherID" );
23
+ assertThat (attributes .size ()).isEqualTo (0 );
24
+ }
25
+ }
You can’t perform that action at this time.
0 commit comments