1
1
/*
2
- * Copyright 2013-2021 the original author or authors.
2
+ * Copyright 2013-2022 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -1208,7 +1208,7 @@ void mapNestedStringFieldCorrectly() {
1208
1208
Document mappedUpdate = mapper .getMappedObject (update .getUpdateObject (),
1209
1209
context .getPersistentEntity (EntityWithNestedMap .class ));
1210
1210
1211
- assertThat (mappedUpdate ).isEqualTo (new org .bson .Document ("$set" ,new org .bson .Document ("levelOne.a.b.d" ,"e" )));
1211
+ assertThat (mappedUpdate ).isEqualTo (new org .bson .Document ("$set" , new org .bson .Document ("levelOne.a.b.d" , "e" )));
1212
1212
}
1213
1213
1214
1214
@ Test // GH-3775
@@ -1218,7 +1218,7 @@ void mapNestedIntegerFieldCorrectly() {
1218
1218
Document mappedUpdate = mapper .getMappedObject (update .getUpdateObject (),
1219
1219
context .getPersistentEntity (EntityWithNestedMap .class ));
1220
1220
1221
- assertThat (mappedUpdate ).isEqualTo (new org .bson .Document ("$set" ,new org .bson .Document ("levelOne.0.1.3" ,"4" )));
1221
+ assertThat (mappedUpdate ).isEqualTo (new org .bson .Document ("$set" , new org .bson .Document ("levelOne.0.1.3" , "4" )));
1222
1222
}
1223
1223
1224
1224
@ Test // GH-3775
@@ -1228,7 +1228,7 @@ void mapNestedMixedStringIntegerFieldCorrectly() {
1228
1228
Document mappedUpdate = mapper .getMappedObject (update .getUpdateObject (),
1229
1229
context .getPersistentEntity (EntityWithNestedMap .class ));
1230
1230
1231
- assertThat (mappedUpdate ).isEqualTo (new org .bson .Document ("$set" ,new org .bson .Document ("levelOne.0.1.c" ,"4" )));
1231
+ assertThat (mappedUpdate ).isEqualTo (new org .bson .Document ("$set" , new org .bson .Document ("levelOne.0.1.c" , "4" )));
1232
1232
}
1233
1233
1234
1234
@ Test // GH-3775
@@ -1238,7 +1238,7 @@ void mapNestedMixedStringIntegerWithStartNumberFieldCorrectly() {
1238
1238
Document mappedUpdate = mapper .getMappedObject (update .getUpdateObject (),
1239
1239
context .getPersistentEntity (EntityWithNestedMap .class ));
1240
1240
1241
- assertThat (mappedUpdate ).isEqualTo (new org .bson .Document ("$set" ,new org .bson .Document ("levelOne.0a.1b.3c" ,"4" )));
1241
+ assertThat (mappedUpdate ).isEqualTo (new org .bson .Document ("$set" , new org .bson .Document ("levelOne.0a.1b.3c" , "4" )));
1242
1242
}
1243
1243
1244
1244
@ Test // GH-3688
@@ -1258,7 +1258,7 @@ void mapNumericKeyInPathHavingComplexMapValyeTypes() {
1258
1258
Document mappedUpdate = mapper .getMappedObject (update .getUpdateObject (),
1259
1259
context .getPersistentEntity (TestData .class ));
1260
1260
1261
- assertThat (mappedUpdate ).isEqualTo (new org . bson . Document ( " $set" , new org . bson . Document ( " testInnerData.testMap.1.intValue" , "4" )) );
1261
+ assertThat (mappedUpdate ).isEqualTo ("{ $set: { ' testInnerData.testMap.1.intValue': '4' }}" );
1262
1262
}
1263
1263
1264
1264
@ Test // GH-3921
@@ -1268,7 +1268,7 @@ void mapNumericKeyInPathNotMatchingExistingProperties() {
1268
1268
Document mappedUpdate = mapper .getMappedObject (update .getUpdateObject (),
1269
1269
context .getPersistentEntity (TestData .class ));
1270
1270
1271
- assertThat (mappedUpdate ).isEqualTo (new org . bson . Document ( " $set" , new org . bson . Document ( " testInnerData.imaginaryMap.1.noExistingProperty" , "4" )) );
1271
+ assertThat (mappedUpdate ).isEqualTo ("{ $set: { ' testInnerData.imaginaryMap.1.nonExistingProperty': '4' }}" );
1272
1272
}
1273
1273
1274
1274
@ Test // GH-3921
@@ -1278,7 +1278,7 @@ void mapNumericKeyInPathPartiallyMatchingExistingProperties() {
1278
1278
Document mappedUpdate = mapper .getMappedObject (update .getUpdateObject (),
1279
1279
context .getPersistentEntity (TestData .class ));
1280
1280
1281
- assertThat (mappedUpdate ).isEqualTo (new org . bson . Document ( " $set" , new org . bson . Document ( " testInnerData.testMap.1.nonExistingProperty.2.someValue" , "4" )) );
1281
+ assertThat (mappedUpdate ).isEqualTo ("{ $set: { ' testInnerData.testMap.1.nonExistingProperty.2.someValue': '4' }}" );
1282
1282
}
1283
1283
1284
1284
static class DomainTypeWrappingConcreteyTypeHavingListOfInterfaceTypeAttributes {
@@ -1517,7 +1517,7 @@ static class EntityWithObjectMap {
1517
1517
Map <Object , NestedDocument > concreteMap ;
1518
1518
}
1519
1519
1520
- static class EntityWithIntKeyedMap {
1520
+ static class EntityWithIntKeyedMap {
1521
1521
Map <Integer , EntityWithObjectMap > intKeyedMap ;
1522
1522
}
1523
1523
@@ -1653,8 +1653,7 @@ static class EntityWithNestedMap {
1653
1653
1654
1654
@ Data
1655
1655
private static class TestData {
1656
- @ Id
1657
- private String id ;
1656
+ @ Id private String id ;
1658
1657
private TestInnerData testInnerData ;
1659
1658
}
1660
1659
0 commit comments