DATACMNS-1120 - Introduced caching of PropertyPath instances.
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
package org.springframework.data.mapping;
|
||||
|
||||
import static org.assertj.core.api.Assertions.*;
|
||||
import static org.springframework.data.mapping.PropertyPath.*;
|
||||
import static org.springframework.data.mapping.PropertyPath.from;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
@@ -345,6 +345,11 @@ public class PropertyPathUnitTests {
|
||||
assertThat(path.hasNext()).isFalse();
|
||||
}
|
||||
|
||||
@Test // DATACMNS-1120
|
||||
public void cachesPropertyPathsByPathAndType() {
|
||||
assertThat(from("userName", Foo.class)).isSameAs(from("userName", Foo.class));
|
||||
}
|
||||
|
||||
private class Foo {
|
||||
|
||||
String userName;
|
||||
|
||||
Reference in New Issue
Block a user