DATACMNS-38 - Added unit test for adding a self-referencing entity to the mapping context.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package org.springframework.data.document.mongodb.mapping;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* Unit tests for {@link MongoMappingContext}.
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
*/
|
||||
public class MongoMappingContextUnitTests {
|
||||
|
||||
@Test
|
||||
public void addsSelfReferencingPersistentEntityCorrectly() {
|
||||
MongoMappingContext context = new MongoMappingContext();
|
||||
context.setInitialEntitySet(Collections.singleton(SampleClass.class));
|
||||
context.afterPropertiesSet();
|
||||
}
|
||||
|
||||
public class SampleClass {
|
||||
|
||||
Map<String, SampleClass> children;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user