@@ -2411,7 +2411,6 @@ void shouldUseMostConcreteCustomConversionTargetOnRead() {
2411
2411
verify (subTypeOfGenericTypeConverter ).convert (eq (source ));
2412
2412
}
2413
2413
2414
-
2415
2414
@ Test // GH-3660
2416
2415
void usesCustomConverterForMapTypesOnWrite () {
2417
2416
@@ -2455,9 +2454,8 @@ void usesCustomConverterForTypesImplementingMapOnRead() {
2455
2454
}));
2456
2455
converter .afterPropertiesSet ();
2457
2456
2458
- org .bson .Document source = new org .bson .Document ("1st" , "one" )
2459
- .append ("2nd" , 2 )
2460
- .append ("_class" , TypeImplementingMap .class .getName ());
2457
+ org .bson .Document source = new org .bson .Document ("1st" , "one" ).append ("2nd" , 2 ).append ("_class" ,
2458
+ TypeImplementingMap .class .getName ());
2461
2459
2462
2460
TypeImplementingMap target = converter .read (TypeImplementingMap .class , source );
2463
2461
@@ -2492,9 +2490,8 @@ void usesCustomConverterForPropertiesUsingTypesImplementingMapOnRead() {
2492
2490
converter .afterPropertiesSet ();
2493
2491
2494
2492
org .bson .Document source = new org .bson .Document ("typeImplementingMap" ,
2495
- new org .bson .Document ("1st" , "one" )
2496
- .append ("2nd" , 2 ))
2497
- .append ("_class" , TypeWrappingTypeImplementingMap .class .getName ());
2493
+ new org .bson .Document ("1st" , "one" ).append ("2nd" , 2 )).append ("_class" ,
2494
+ TypeWrappingTypeImplementingMap .class .getName ());
2498
2495
2499
2496
TypeWrappingTypeImplementingMap target = converter .read (TypeWrappingTypeImplementingMap .class , source );
2500
2497
@@ -2516,13 +2513,12 @@ void shouldWriteNullPropertyCorrectly() {
2516
2513
@ Test // GH-3686
2517
2514
void readsCollectionContainingNullValue () {
2518
2515
2519
- org .bson .Document source = new org .bson .Document ("items" , Arrays .asList (new org .bson .Document ("itemKey" , "i1" ), null , new org .bson .Document ("itemKey" , "i3" )));
2516
+ org .bson .Document source = new org .bson .Document ("items" ,
2517
+ Arrays .asList (new org .bson .Document ("itemKey" , "i1" ), null , new org .bson .Document ("itemKey" , "i3" )));
2520
2518
2521
2519
Order target = converter .read (Order .class , source );
2522
2520
2523
- assertThat (target .items )
2524
- .map (it -> it != null ? it .itemKey : null )
2525
- .containsExactly ("i1" , null , "i3" );
2521
+ assertThat (target .items ).map (it -> it != null ? it .itemKey : null ).containsExactly ("i1" , null , "i3" );
2526
2522
}
2527
2523
2528
2524
@ Test // GH-3686
@@ -2538,14 +2534,13 @@ void readsArrayContainingNullValue() {
2538
2534
@ Test // GH-3686
2539
2535
void readsMapContainingNullValue () {
2540
2536
2541
- org .bson .Document source = new org .bson .Document ("mapOfObjects" , new org .bson .Document ("item1" , "i1" ).append ("item2" , null ).append ("item3" , "i3" ));
2537
+ org .bson .Document source = new org .bson .Document ("mapOfObjects" ,
2538
+ new org .bson .Document ("item1" , "i1" ).append ("item2" , null ).append ("item3" , "i3" ));
2542
2539
2543
2540
ClassWithMapProperty target = converter .read (ClassWithMapProperty .class , source );
2544
2541
2545
- assertThat (target .mapOfObjects )
2546
- .containsEntry ("item1" , "i1" )
2547
- .containsEntry ("item2" , null )
2548
- .containsEntry ("item3" , "i3" );
2542
+ assertThat (target .mapOfObjects ).containsEntry ("item1" , "i1" ).containsEntry ("item2" , null ).containsEntry ("item3" ,
2543
+ "i3" );
2549
2544
}
2550
2545
2551
2546
@ Test // GH-3670
@@ -2557,7 +2552,7 @@ void appliesCustomConverterEvenToSimpleTypes() {
2557
2552
}));
2558
2553
converter .afterPropertiesSet ();
2559
2554
2560
- org .bson .Document source = new org .bson .Document ("content" , new Binary (new byte [] {0x00 , 0x42 }));
2555
+ org .bson .Document source = new org .bson .Document ("content" , new Binary (new byte [] { 0x00 , 0x42 }));
2561
2556
2562
2557
GenericType <Object > target = converter .read (GenericType .class , source );
2563
2558
assertThat (target .content ).isInstanceOf (byte [].class );
@@ -2566,17 +2561,20 @@ void appliesCustomConverterEvenToSimpleTypes() {
2566
2561
@ Test // GH-3702
2567
2562
void readsRawDocument () {
2568
2563
2569
- org .bson .Document source = new org .bson .Document ("_id" , "id-1" ).append ("raw" , new org .bson .Document ("simple" , 1 ).append ("document" , new org .bson .Document ("inner-doc" , 1 )));
2564
+ org .bson .Document source = new org .bson .Document ("_id" , "id-1" ).append ("raw" ,
2565
+ new org .bson .Document ("simple" , 1 ).append ("document" , new org .bson .Document ("inner-doc" , 1 )));
2570
2566
2571
2567
WithRawDocumentProperties target = converter .read (WithRawDocumentProperties .class , source );
2572
2568
2573
- assertThat (target .raw ).isInstanceOf (org .bson .Document .class ).isEqualTo ( new org .bson .Document ("simple" , 1 ).append ("document" , new org .bson .Document ("inner-doc" , 1 )));
2569
+ assertThat (target .raw ).isInstanceOf (org .bson .Document .class )
2570
+ .isEqualTo (new org .bson .Document ("simple" , 1 ).append ("document" , new org .bson .Document ("inner-doc" , 1 )));
2574
2571
}
2575
2572
2576
2573
@ Test // GH-3702
2577
2574
void readsListOfRawDocument () {
2578
2575
2579
- org .bson .Document source = new org .bson .Document ("_id" , "id-1" ).append ("listOfRaw" , Arrays .asList (new org .bson .Document ("simple" , 1 ).append ("document" , new org .bson .Document ("inner-doc" , 1 ))));
2576
+ org .bson .Document source = new org .bson .Document ("_id" , "id-1" ).append ("listOfRaw" ,
2577
+ Arrays .asList (new org .bson .Document ("simple" , 1 ).append ("document" , new org .bson .Document ("inner-doc" , 1 ))));
2580
2578
2581
2579
WithRawDocumentProperties target = converter .read (WithRawDocumentProperties .class , source );
2582
2580
@@ -2587,11 +2585,12 @@ void readsListOfRawDocument() {
2587
2585
@ Test // GH-3692
2588
2586
void readsMapThatDoesNotComeAsDocument () {
2589
2587
2590
- org .bson .Document source = new org .bson .Document ("_id" , "id-1" ).append ("mapOfObjects" , Collections .singletonMap ("simple" , 1 ));
2588
+ org .bson .Document source = new org .bson .Document ("_id" , "id-1" ).append ("mapOfObjects" ,
2589
+ Collections .singletonMap ("simple" , 1 ));
2591
2590
2592
2591
ClassWithMapProperty target = converter .read (ClassWithMapProperty .class , source );
2593
2592
2594
- assertThat (target .mapOfObjects ).containsEntry ("simple" ,1 );
2593
+ assertThat (target .mapOfObjects ).containsEntry ("simple" , 1 );
2595
2594
}
2596
2595
2597
2596
@ Test // GH-3851
@@ -2611,7 +2610,8 @@ void readsMapThatDoesNotComeAsDocument() {
2611
2610
2612
2611
converter .writePropertyInternal (sourceValue , accessor , persistentProperty );
2613
2612
2614
- assertThat (accessor .getDocument ()).isEqualTo (new org .bson .Document ("pName" , new org .bson .Document ("_id" , id .toString ())));
2613
+ assertThat (accessor .getDocument ())
2614
+ .isEqualTo (new org .bson .Document ("pName" , new org .bson .Document ("_id" , id .toString ())));
2615
2615
}
2616
2616
2617
2617
@ Test // GH-2860
@@ -2626,8 +2626,7 @@ void projectShouldReadSimpleInterfaceProjection() {
2626
2626
.and ((target , underlyingType ) -> !converter .conversions .isSimpleType (target )),
2627
2627
mappingContext );
2628
2628
2629
- EntityProjection <PersonProjection , Person > projection = discoverer
2630
- .introspect (PersonProjection .class , Person .class );
2629
+ EntityProjection <PersonProjection , Person > projection = discoverer .introspect (PersonProjection .class , Person .class );
2631
2630
PersonProjection person = converter .project (projection , source );
2632
2631
2633
2632
assertThat (person .getBirthDate ()).isEqualTo (LocalDate .of (1999 , 12 , 1 ));
@@ -2646,8 +2645,7 @@ void projectShouldReadSimpleDtoProjection() {
2646
2645
.and ((target , underlyingType ) -> !converter .conversions .isSimpleType (target )),
2647
2646
mappingContext );
2648
2647
2649
- EntityProjection <PersonDto , Person > projection = introspector
2650
- .introspect (PersonDto .class , Person .class );
2648
+ EntityProjection <PersonDto , Person > projection = introspector .introspect (PersonDto .class , Person .class );
2651
2649
PersonDto person = converter .project (projection , source );
2652
2650
2653
2651
assertThat (person .getBirthDate ()).isEqualTo (LocalDate .of (1999 , 12 , 1 ));
@@ -2738,8 +2736,7 @@ interface InterfaceType {
2738
2736
@ EqualsAndHashCode
2739
2737
@ Getter
2740
2738
static class Address implements InterfaceType {
2741
- @ Field ("s" )
2742
- String street ;
2739
+ @ Field ("s" ) String street ;
2743
2740
String city ;
2744
2741
}
2745
2742
@@ -3340,7 +3337,7 @@ static class TypeWrappingTypeImplementingMap {
3340
3337
}
3341
3338
3342
3339
@ EqualsAndHashCode
3343
- static class TypeImplementingMap implements Map <String ,String > {
3340
+ static class TypeImplementingMap implements Map <String , String > {
3344
3341
3345
3342
String val1 ;
3346
3343
int val2 ;
0 commit comments