16
16
17
17
package org .springframework .beans ;
18
18
19
- import java .util .Arrays ;
20
-
21
19
import org .junit .Test ;
22
20
23
21
import static org .assertj .core .api .Assertions .assertThat ;
24
22
25
23
/**
24
+ * Unit tests for {@link PropertyAccessorUtils}.
25
+ *
26
26
* @author Juergen Hoeller
27
27
* @author Chris Beams
28
28
*/
29
29
public class PropertyAccessorUtilsTests {
30
30
31
31
@ Test
32
- public void testCanonicalPropertyName () {
32
+ public void canonicalPropertyName () {
33
33
assertThat (PropertyAccessorUtils .canonicalPropertyName ("map" )).isEqualTo ("map" );
34
34
assertThat (PropertyAccessorUtils .canonicalPropertyName ("map[key1]" )).isEqualTo ("map[key1]" );
35
35
assertThat (PropertyAccessorUtils .canonicalPropertyName ("map['key1']" )).isEqualTo ("map[key1]" );
@@ -42,15 +42,15 @@ public void testCanonicalPropertyName() {
42
42
}
43
43
44
44
@ Test
45
- public void testCanonicalPropertyNames () {
45
+ public void canonicalPropertyNames () {
46
46
String [] original =
47
47
new String [] {"map" , "map[key1]" , "map['key1']" , "map[\" key1\" ]" , "map[key1][key2]" ,
48
48
"map['key1'][\" key2\" ]" , "map[key1].name" , "map['key1'].name" , "map[\" key1\" ].name" };
49
49
String [] canonical =
50
50
new String [] {"map" , "map[key1]" , "map[key1]" , "map[key1]" , "map[key1][key2]" ,
51
51
"map[key1][key2]" , "map[key1].name" , "map[key1].name" , "map[key1].name" };
52
52
53
- assertThat (Arrays . equals ( canonical , PropertyAccessorUtils .canonicalPropertyNames (original ))). isTrue ( );
53
+ assertThat (PropertyAccessorUtils .canonicalPropertyNames (original )). isEqualTo ( canonical );
54
54
}
55
55
56
56
}
0 commit comments