|
|
|
|
@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
|
|
|
|
|
/* |
|
|
|
|
* Copyright 2013-2021 the original author or authors. |
|
|
|
|
* Copyright 2013-2022 the original author or authors. |
|
|
|
|
* |
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
|
@ -1208,7 +1208,7 @@ class UpdateMapperUnitTests {
@@ -1208,7 +1208,7 @@ class UpdateMapperUnitTests {
|
|
|
|
|
Document mappedUpdate = mapper.getMappedObject(update.getUpdateObject(), |
|
|
|
|
context.getPersistentEntity(EntityWithNestedMap.class)); |
|
|
|
|
|
|
|
|
|
assertThat(mappedUpdate).isEqualTo(new org.bson.Document("$set",new org.bson.Document("levelOne.a.b.d","e"))); |
|
|
|
|
assertThat(mappedUpdate).isEqualTo(new org.bson.Document("$set", new org.bson.Document("levelOne.a.b.d", "e"))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test // GH-3775
|
|
|
|
|
@ -1218,7 +1218,7 @@ class UpdateMapperUnitTests {
@@ -1218,7 +1218,7 @@ class UpdateMapperUnitTests {
|
|
|
|
|
Document mappedUpdate = mapper.getMappedObject(update.getUpdateObject(), |
|
|
|
|
context.getPersistentEntity(EntityWithNestedMap.class)); |
|
|
|
|
|
|
|
|
|
assertThat(mappedUpdate).isEqualTo(new org.bson.Document("$set",new org.bson.Document("levelOne.0.1.3","4"))); |
|
|
|
|
assertThat(mappedUpdate).isEqualTo(new org.bson.Document("$set", new org.bson.Document("levelOne.0.1.3", "4"))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test // GH-3775
|
|
|
|
|
@ -1228,7 +1228,7 @@ class UpdateMapperUnitTests {
@@ -1228,7 +1228,7 @@ class UpdateMapperUnitTests {
|
|
|
|
|
Document mappedUpdate = mapper.getMappedObject(update.getUpdateObject(), |
|
|
|
|
context.getPersistentEntity(EntityWithNestedMap.class)); |
|
|
|
|
|
|
|
|
|
assertThat(mappedUpdate).isEqualTo(new org.bson.Document("$set",new org.bson.Document("levelOne.0.1.c","4"))); |
|
|
|
|
assertThat(mappedUpdate).isEqualTo(new org.bson.Document("$set", new org.bson.Document("levelOne.0.1.c", "4"))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test // GH-3775
|
|
|
|
|
@ -1238,7 +1238,7 @@ class UpdateMapperUnitTests {
@@ -1238,7 +1238,7 @@ class UpdateMapperUnitTests {
|
|
|
|
|
Document mappedUpdate = mapper.getMappedObject(update.getUpdateObject(), |
|
|
|
|
context.getPersistentEntity(EntityWithNestedMap.class)); |
|
|
|
|
|
|
|
|
|
assertThat(mappedUpdate).isEqualTo(new org.bson.Document("$set",new org.bson.Document("levelOne.0a.1b.3c","4"))); |
|
|
|
|
assertThat(mappedUpdate).isEqualTo(new org.bson.Document("$set", new org.bson.Document("levelOne.0a.1b.3c", "4"))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test // GH-3688
|
|
|
|
|
@ -1258,7 +1258,7 @@ class UpdateMapperUnitTests {
@@ -1258,7 +1258,7 @@ class UpdateMapperUnitTests {
|
|
|
|
|
Document mappedUpdate = mapper.getMappedObject(update.getUpdateObject(), |
|
|
|
|
context.getPersistentEntity(TestData.class)); |
|
|
|
|
|
|
|
|
|
assertThat(mappedUpdate).isEqualTo(new org.bson.Document("$set",new org.bson.Document("testInnerData.testMap.1.intValue","4"))); |
|
|
|
|
assertThat(mappedUpdate).isEqualTo("{ $set: { 'testInnerData.testMap.1.intValue': '4' }}"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test // GH-3921
|
|
|
|
|
@ -1268,7 +1268,7 @@ class UpdateMapperUnitTests {
@@ -1268,7 +1268,7 @@ class UpdateMapperUnitTests {
|
|
|
|
|
Document mappedUpdate = mapper.getMappedObject(update.getUpdateObject(), |
|
|
|
|
context.getPersistentEntity(TestData.class)); |
|
|
|
|
|
|
|
|
|
assertThat(mappedUpdate).isEqualTo(new org.bson.Document("$set",new org.bson.Document("testInnerData.imaginaryMap.1.noExistingProperty","4"))); |
|
|
|
|
assertThat(mappedUpdate).isEqualTo("{ $set: { 'testInnerData.imaginaryMap.1.nonExistingProperty': '4' }}"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test // GH-3921
|
|
|
|
|
@ -1278,7 +1278,7 @@ class UpdateMapperUnitTests {
@@ -1278,7 +1278,7 @@ class UpdateMapperUnitTests {
|
|
|
|
|
Document mappedUpdate = mapper.getMappedObject(update.getUpdateObject(), |
|
|
|
|
context.getPersistentEntity(TestData.class)); |
|
|
|
|
|
|
|
|
|
assertThat(mappedUpdate).isEqualTo(new org.bson.Document("$set",new org.bson.Document("testInnerData.testMap.1.nonExistingProperty.2.someValue","4"))); |
|
|
|
|
assertThat(mappedUpdate).isEqualTo("{ $set: { 'testInnerData.testMap.1.nonExistingProperty.2.someValue': '4' }}"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static class DomainTypeWrappingConcreteyTypeHavingListOfInterfaceTypeAttributes { |
|
|
|
|
@ -1517,7 +1517,7 @@ class UpdateMapperUnitTests {
@@ -1517,7 +1517,7 @@ class UpdateMapperUnitTests {
|
|
|
|
|
Map<Object, NestedDocument> concreteMap; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static class EntityWithIntKeyedMap{ |
|
|
|
|
static class EntityWithIntKeyedMap { |
|
|
|
|
Map<Integer, EntityWithObjectMap> intKeyedMap; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -1653,8 +1653,7 @@ class UpdateMapperUnitTests {
@@ -1653,8 +1653,7 @@ class UpdateMapperUnitTests {
|
|
|
|
|
|
|
|
|
|
@Data |
|
|
|
|
private static class TestData { |
|
|
|
|
@Id |
|
|
|
|
private String id; |
|
|
|
|
@Id private String id; |
|
|
|
|
private TestInnerData testInnerData; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|