@@ -93,30 +93,31 @@ void instantiateClassWithMoreArgsThanParameters() throws NoSuchMethodException {
93
93
Constructor <BeanWithPrimitiveTypes > constructor = getBeanWithPrimitiveTypesConstructor ();
94
94
95
95
assertThatExceptionOfType (BeanInstantiationException .class ).isThrownBy (() ->
96
- BeanUtils .instantiateClass (constructor , null , null , null , null , null , null , null , "foo" , null ));
96
+ BeanUtils .instantiateClass (constructor , null , null , null , null , null , null , null , null , "foo" , null ));
97
97
}
98
98
99
99
@ Test // gh-22531, gh-27390
100
100
void instantiateClassWithOptionalPrimitiveTypes () throws NoSuchMethodException {
101
101
Constructor <BeanWithPrimitiveTypes > constructor = getBeanWithPrimitiveTypesConstructor ();
102
102
103
- BeanWithPrimitiveTypes bean = BeanUtils .instantiateClass (constructor , null , null , null , null , null , null , null , "foo" );
103
+ BeanWithPrimitiveTypes bean = BeanUtils .instantiateClass (constructor , null , null , null , null , null , null , null , null , "foo" );
104
104
105
105
assertSoftly (softly -> {
106
- softly .assertThat (bean .isFlag ()).isEqualTo ( false );
106
+ softly .assertThat (bean .isFlag ()).isFalse ( );
107
107
softly .assertThat (bean .getByteCount ()).isEqualTo ((byte ) 0 );
108
108
softly .assertThat (bean .getShortCount ()).isEqualTo ((short ) 0 );
109
109
softly .assertThat (bean .getIntCount ()).isEqualTo (0 );
110
110
softly .assertThat (bean .getLongCount ()).isEqualTo (0L );
111
111
softly .assertThat (bean .getFloatCount ()).isEqualTo (0F );
112
112
softly .assertThat (bean .getDoubleCount ()).isEqualTo (0D );
113
+ softly .assertThat (bean .getCharacter ()).isEqualTo ('\0' );
113
114
softly .assertThat (bean .getText ()).isEqualTo ("foo" );
114
115
});
115
116
}
116
117
117
118
private Constructor <BeanWithPrimitiveTypes > getBeanWithPrimitiveTypesConstructor () throws NoSuchMethodException {
118
119
return BeanWithPrimitiveTypes .class .getConstructor (boolean .class , byte .class , short .class , int .class ,
119
- long .class , float .class , double .class , String .class );
120
+ long .class , float .class , double .class , char . class , String .class );
120
121
}
121
122
122
123
@ Test
@@ -566,19 +567,22 @@ private static class BeanWithPrimitiveTypes {
566
567
private long longCount ;
567
568
private float floatCount ;
568
569
private double doubleCount ;
570
+ private char character ;
569
571
private String text ;
570
572
571
573
572
574
@ SuppressWarnings ("unused" )
573
575
public BeanWithPrimitiveTypes (boolean flag , byte byteCount , short shortCount , int intCount , long longCount ,
574
- float floatCount , double doubleCount , String text ) {
576
+ float floatCount , double doubleCount , char character , String text ) {
577
+
575
578
this .flag = flag ;
576
579
this .byteCount = byteCount ;
577
580
this .shortCount = shortCount ;
578
581
this .intCount = intCount ;
579
582
this .longCount = longCount ;
580
583
this .floatCount = floatCount ;
581
584
this .doubleCount = doubleCount ;
585
+ this .character = character ;
582
586
this .text = text ;
583
587
}
584
588
@@ -610,6 +614,10 @@ public double getDoubleCount() {
610
614
return doubleCount ;
611
615
}
612
616
617
+ public char getCharacter () {
618
+ return character ;
619
+ }
620
+
613
621
public String getText () {
614
622
return text ;
615
623
}
0 commit comments