Test unwrapped.empty instantiation when used as ctor argument.
Original Pull Request: #4492
This commit is contained in:
@@ -2368,6 +2368,21 @@ class MappingMongoConverterUnitTests {
|
||||
.isEqualTo(expected);
|
||||
}
|
||||
|
||||
@Test // GH-4491
|
||||
void readUnwrappedTypeWithComplexValueUsingConstructorWhenUnwrappedPropertiesNotPresent() {
|
||||
|
||||
org.bson.Document source = new org.bson.Document("_id", "id-1");
|
||||
|
||||
WithUnwrappedConstructor target = converter.read(WithUnwrappedConstructor.class, source);
|
||||
|
||||
assertThat(target.id).isEqualTo("id-1");
|
||||
assertThat(target.embeddableValue).isNotNull(); // it's defined as Empty
|
||||
assertThat(target.embeddableValue.stringValue) //
|
||||
.isNull();
|
||||
assertThat(target.embeddableValue.address) //
|
||||
.isNull();
|
||||
}
|
||||
|
||||
@Test // DATAMONGO-1902
|
||||
void writeUnwrappedTypeWithComplexValue() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user