@@ -2438,7 +2438,6 @@ void shouldUseMostConcreteCustomConversionTargetOnRead() {
24382438 verify (subTypeOfGenericTypeConverter ).convert (eq (source ));
24392439 }
24402440
2441-
24422441 @ Test // GH-3660
24432442 void usesCustomConverterForMapTypesOnWrite () {
24442443
@@ -2482,9 +2481,8 @@ void usesCustomConverterForTypesImplementingMapOnRead() {
24822481 }));
24832482 converter .afterPropertiesSet ();
24842483
2485- org .bson .Document source = new org .bson .Document ("1st" , "one" )
2486- .append ("2nd" , 2 )
2487- .append ("_class" , TypeImplementingMap .class .getName ());
2484+ org .bson .Document source = new org .bson .Document ("1st" , "one" ).append ("2nd" , 2 ).append ("_class" ,
2485+ TypeImplementingMap .class .getName ());
24882486
24892487 TypeImplementingMap target = converter .read (TypeImplementingMap .class , source );
24902488
@@ -2519,9 +2517,8 @@ void usesCustomConverterForPropertiesUsingTypesImplementingMapOnRead() {
25192517 converter .afterPropertiesSet ();
25202518
25212519 org .bson .Document source = new org .bson .Document ("typeImplementingMap" ,
2522- new org .bson .Document ("1st" , "one" )
2523- .append ("2nd" , 2 ))
2524- .append ("_class" , TypeWrappingTypeImplementingMap .class .getName ());
2520+ new org .bson .Document ("1st" , "one" ).append ("2nd" , 2 )).append ("_class" ,
2521+ TypeWrappingTypeImplementingMap .class .getName ());
25252522
25262523 TypeWrappingTypeImplementingMap target = converter .read (TypeWrappingTypeImplementingMap .class , source );
25272524
@@ -2543,13 +2540,12 @@ void shouldWriteNullPropertyCorrectly() {
25432540 @ Test // GH-3686
25442541 void readsCollectionContainingNullValue () {
25452542
2546- org .bson .Document source = new org .bson .Document ("items" , Arrays .asList (new org .bson .Document ("itemKey" , "i1" ), null , new org .bson .Document ("itemKey" , "i3" )));
2543+ org .bson .Document source = new org .bson .Document ("items" ,
2544+ Arrays .asList (new org .bson .Document ("itemKey" , "i1" ), null , new org .bson .Document ("itemKey" , "i3" )));
25472545
25482546 Order target = converter .read (Order .class , source );
25492547
2550- assertThat (target .items )
2551- .map (it -> it != null ? it .itemKey : null )
2552- .containsExactly ("i1" , null , "i3" );
2548+ assertThat (target .items ).map (it -> it != null ? it .itemKey : null ).containsExactly ("i1" , null , "i3" );
25532549 }
25542550
25552551 @ Test // GH-3686
@@ -2565,14 +2561,13 @@ void readsArrayContainingNullValue() {
25652561 @ Test // GH-3686
25662562 void readsMapContainingNullValue () {
25672563
2568- org .bson .Document source = new org .bson .Document ("mapOfObjects" , new org .bson .Document ("item1" , "i1" ).append ("item2" , null ).append ("item3" , "i3" ));
2564+ org .bson .Document source = new org .bson .Document ("mapOfObjects" ,
2565+ new org .bson .Document ("item1" , "i1" ).append ("item2" , null ).append ("item3" , "i3" ));
25692566
25702567 ClassWithMapProperty target = converter .read (ClassWithMapProperty .class , source );
25712568
2572- assertThat (target .mapOfObjects )
2573- .containsEntry ("item1" , "i1" )
2574- .containsEntry ("item2" , null )
2575- .containsEntry ("item3" , "i3" );
2569+ assertThat (target .mapOfObjects ).containsEntry ("item1" , "i1" ).containsEntry ("item2" , null ).containsEntry ("item3" ,
2570+ "i3" );
25762571 }
25772572
25782573 @ Test // GH-3670
@@ -2584,7 +2579,7 @@ void appliesCustomConverterEvenToSimpleTypes() {
25842579 }));
25852580 converter .afterPropertiesSet ();
25862581
2587- org .bson .Document source = new org .bson .Document ("content" , new Binary (new byte [] {0x00 , 0x42 }));
2582+ org .bson .Document source = new org .bson .Document ("content" , new Binary (new byte [] { 0x00 , 0x42 }));
25882583
25892584 GenericType <Object > target = converter .read (GenericType .class , source );
25902585 assertThat (target .content ).isInstanceOf (byte [].class );
@@ -2593,17 +2588,20 @@ void appliesCustomConverterEvenToSimpleTypes() {
25932588 @ Test // GH-3702
25942589 void readsRawDocument () {
25952590
2596- 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 )));
2591+ org .bson .Document source = new org .bson .Document ("_id" , "id-1" ).append ("raw" ,
2592+ new org .bson .Document ("simple" , 1 ).append ("document" , new org .bson .Document ("inner-doc" , 1 )));
25972593
25982594 WithRawDocumentProperties target = converter .read (WithRawDocumentProperties .class , source );
25992595
2600- assertThat (target .raw ).isInstanceOf (org .bson .Document .class ).isEqualTo ( new org .bson .Document ("simple" , 1 ).append ("document" , new org .bson .Document ("inner-doc" , 1 )));
2596+ assertThat (target .raw ).isInstanceOf (org .bson .Document .class )
2597+ .isEqualTo (new org .bson .Document ("simple" , 1 ).append ("document" , new org .bson .Document ("inner-doc" , 1 )));
26012598 }
26022599
26032600 @ Test // GH-3702
26042601 void readsListOfRawDocument () {
26052602
2606- 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 ))));
2603+ org .bson .Document source = new org .bson .Document ("_id" , "id-1" ).append ("listOfRaw" ,
2604+ Arrays .asList (new org .bson .Document ("simple" , 1 ).append ("document" , new org .bson .Document ("inner-doc" , 1 ))));
26072605
26082606 WithRawDocumentProperties target = converter .read (WithRawDocumentProperties .class , source );
26092607
@@ -2614,11 +2612,12 @@ void readsListOfRawDocument() {
26142612 @ Test // GH-3692
26152613 void readsMapThatDoesNotComeAsDocument () {
26162614
2617- org .bson .Document source = new org .bson .Document ("_id" , "id-1" ).append ("mapOfObjects" , Collections .singletonMap ("simple" , 1 ));
2615+ org .bson .Document source = new org .bson .Document ("_id" , "id-1" ).append ("mapOfObjects" ,
2616+ Collections .singletonMap ("simple" , 1 ));
26182617
26192618 ClassWithMapProperty target = converter .read (ClassWithMapProperty .class , source );
26202619
2621- assertThat (target .mapOfObjects ).containsEntry ("simple" ,1 );
2620+ assertThat (target .mapOfObjects ).containsEntry ("simple" , 1 );
26222621 }
26232622
26242623 @ Test // GH-3851
@@ -2638,7 +2637,8 @@ void readsMapThatDoesNotComeAsDocument() {
26382637
26392638 converter .writePropertyInternal (sourceValue , accessor , persistentProperty );
26402639
2641- assertThat (accessor .getDocument ()).isEqualTo (new org .bson .Document ("pName" , new org .bson .Document ("_id" , id .toString ())));
2640+ assertThat (accessor .getDocument ())
2641+ .isEqualTo (new org .bson .Document ("pName" , new org .bson .Document ("_id" , id .toString ())));
26422642 }
26432643
26442644 @ Test // GH-2860
@@ -2652,8 +2652,7 @@ void projectShouldReadSimpleInterfaceProjection() {
26522652 .and ((target , underlyingType ) -> !converter .conversions .isSimpleType (target )),
26532653 mappingContext );
26542654
2655- EntityProjection <PersonProjection , Person > projection = discoverer
2656- .introspect (PersonProjection .class , Person .class );
2655+ EntityProjection <PersonProjection , Person > projection = discoverer .introspect (PersonProjection .class , Person .class );
26572656 PersonProjection person = converter .project (projection , source );
26582657
26592658 assertThat (person .getBirthDate ()).isEqualTo (new LocalDate (1999 , 12 , 1 ));
@@ -2671,8 +2670,7 @@ void projectShouldReadSimpleDtoProjection() {
26712670 .and ((target , underlyingType ) -> !converter .conversions .isSimpleType (target )),
26722671 mappingContext );
26732672
2674- EntityProjection <PersonDto , Person > projection = introspector
2675- .introspect (PersonDto .class , Person .class );
2673+ EntityProjection <PersonDto , Person > projection = introspector .introspect (PersonDto .class , Person .class );
26762674 PersonDto person = converter .project (projection , source );
26772675
26782676 assertThat (person .getBirthDate ()).isEqualTo (new LocalDate (1999 , 12 , 1 ));
@@ -2763,8 +2761,7 @@ interface InterfaceType {
27632761 @ EqualsAndHashCode
27642762 @ Getter
27652763 static class Address implements InterfaceType {
2766- @ Field ("s" )
2767- String street ;
2764+ @ Field ("s" ) String street ;
27682765 String city ;
27692766 }
27702767
@@ -3365,7 +3362,7 @@ static class TypeWrappingTypeImplementingMap {
33653362 }
33663363
33673364 @ EqualsAndHashCode
3368- static class TypeImplementingMap implements Map <String ,String > {
3365+ static class TypeImplementingMap implements Map <String , String > {
33693366
33703367 String val1 ;
33713368 int val2 ;
@@ -3480,15 +3477,9 @@ static class Book {
34803477
34813478 Author author = new Author ();
34823479
3483- public Book () {}
3484-
3485- public Book (String id , String name , Author author ) {
3486- this .id = id ;
3487- this .name = name ;
3488- this .author = author ;
3489- }
34903480 }
34913481
3482+ @ Data
34923483 static class Author {
34933484
34943485 @ Id String id ;
@@ -3497,14 +3488,6 @@ static class Author {
34973488
34983489 String lastName ;
34993490
3500- public Author () {}
3501-
3502- public Author (String id , String firstName , String lastName ) {
3503- this .id = id ;
3504- this .firstName = firstName ;
3505- this .lastName = lastName ;
3506- }
3507-
35083491 }
35093492
35103493}
0 commit comments