DATACMNS-1120 - Introduced caching of PropertyPath instances.

This commit is contained in:
Oliver Gierke
2017-07-20 12:51:30 +02:00
parent 75ac90150f
commit 5e4cac308e
2 changed files with 39 additions and 20 deletions

View File

@@ -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;