Skip to content

Commit c9d5565

Browse files
committed
DATACMNS-38 - Added unit test for adding a self-referencing entity to the mapping context.
1 parent 30e96f9 commit c9d5565

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package org.springframework.data.document.mongodb.mapping;
2+
3+
import java.util.Collections;
4+
import java.util.Map;
5+
6+
import org.junit.Test;
7+
8+
/**
9+
* Unit tests for {@link MongoMappingContext}.
10+
*
11+
* @author Oliver Gierke
12+
*/
13+
public class MongoMappingContextUnitTests {
14+
15+
@Test
16+
public void addsSelfReferencingPersistentEntityCorrectly() {
17+
MongoMappingContext context = new MongoMappingContext();
18+
context.setInitialEntitySet(Collections.singleton(SampleClass.class));
19+
context.afterPropertiesSet();
20+
}
21+
22+
public class SampleClass {
23+
24+
Map<String, SampleClass> children;
25+
}
26+
}

0 commit comments

Comments
 (0)