@@ -63,12 +63,12 @@ void autowiredFieldWithSingleNonQualifiedCandidate() {
63
63
new RootBeanDefinition (QualifiedFieldTestBean .class ));
64
64
AnnotationConfigUtils .registerAnnotationConfigProcessors (context );
65
65
66
- assertThatExceptionOfType (BeanCreationException .class ). isThrownBy (
67
- context ::refresh )
68
- .satisfies (ex -> {
69
- assertThat (ex .getRootCause ()).isInstanceOf (NoSuchBeanDefinitionException .class );
70
- assertThat (ex .getBeanName ()).isEqualTo ("autowired" );
71
- });
66
+ assertThatExceptionOfType (BeanCreationException .class )
67
+ . isThrownBy ( context ::refresh )
68
+ .satisfies (ex -> {
69
+ assertThat (ex .getRootCause ()).isInstanceOf (NoSuchBeanDefinitionException .class );
70
+ assertThat (ex .getBeanName ()).isEqualTo ("autowired" );
71
+ });
72
72
}
73
73
74
74
@ Test
@@ -81,12 +81,13 @@ void autowiredMethodParameterWithSingleNonQualifiedCandidate() {
81
81
context .registerBeanDefinition ("autowired" ,
82
82
new RootBeanDefinition (QualifiedMethodParameterTestBean .class ));
83
83
AnnotationConfigUtils .registerAnnotationConfigProcessors (context );
84
- assertThatExceptionOfType (BeanCreationException .class ).isThrownBy (
85
- context ::refresh )
86
- .satisfies (ex -> {
87
- assertThat (ex .getRootCause ()).isInstanceOf (NoSuchBeanDefinitionException .class );
88
- assertThat (ex .getBeanName ()).isEqualTo ("autowired" );
89
- });
84
+
85
+ assertThatExceptionOfType (BeanCreationException .class )
86
+ .isThrownBy (context ::refresh )
87
+ .satisfies (ex -> {
88
+ assertThat (ex .getRootCause ()).isInstanceOf (NoSuchBeanDefinitionException .class );
89
+ assertThat (ex .getBeanName ()).isEqualTo ("autowired" );
90
+ });
90
91
91
92
}
92
93
@@ -100,9 +101,10 @@ void autowiredConstructorArgumentWithSingleNonQualifiedCandidate() {
100
101
context .registerBeanDefinition ("autowired" ,
101
102
new RootBeanDefinition (QualifiedConstructorArgumentTestBean .class ));
102
103
AnnotationConfigUtils .registerAnnotationConfigProcessors (context );
103
- assertThatExceptionOfType (UnsatisfiedDependencyException .class ).isThrownBy (
104
- context ::refresh )
105
- .satisfies (ex -> assertThat (ex .getBeanName ()).isEqualTo ("autowired" ));
104
+
105
+ assertThatExceptionOfType (UnsatisfiedDependencyException .class )
106
+ .isThrownBy (context ::refresh )
107
+ .satisfies (ex -> assertThat (ex .getBeanName ()).isEqualTo ("autowired" ));
106
108
}
107
109
108
110
@ Test
@@ -205,12 +207,13 @@ void autowiredFieldWithMultipleNonQualifiedCandidates() {
205
207
context .registerBeanDefinition ("autowired" ,
206
208
new RootBeanDefinition (QualifiedFieldTestBean .class ));
207
209
AnnotationConfigUtils .registerAnnotationConfigProcessors (context );
208
- assertThatExceptionOfType (BeanCreationException .class ).isThrownBy (
209
- context ::refresh )
210
- .satisfies (ex -> {
211
- assertThat (ex .getRootCause ()).isInstanceOf (NoSuchBeanDefinitionException .class );
212
- assertThat (ex .getBeanName ()).isEqualTo ("autowired" );
213
- });
210
+
211
+ assertThatExceptionOfType (BeanCreationException .class )
212
+ .isThrownBy (context ::refresh )
213
+ .satisfies (ex -> {
214
+ assertThat (ex .getRootCause ()).isInstanceOf (NoSuchBeanDefinitionException .class );
215
+ assertThat (ex .getBeanName ()).isEqualTo ("autowired" );
216
+ });
214
217
}
215
218
216
219
@ Test
@@ -227,12 +230,13 @@ void autowiredMethodParameterWithMultipleNonQualifiedCandidates() {
227
230
context .registerBeanDefinition ("autowired" ,
228
231
new RootBeanDefinition (QualifiedMethodParameterTestBean .class ));
229
232
AnnotationConfigUtils .registerAnnotationConfigProcessors (context );
230
- assertThatExceptionOfType (BeanCreationException .class ).isThrownBy (
231
- context ::refresh )
232
- .satisfies (ex -> {
233
- assertThat (ex .getRootCause ()).isInstanceOf (NoSuchBeanDefinitionException .class );
234
- assertThat (ex .getBeanName ()).isEqualTo ("autowired" );
235
- });
233
+
234
+ assertThatExceptionOfType (BeanCreationException .class )
235
+ .isThrownBy (context ::refresh )
236
+ .satisfies (ex -> {
237
+ assertThat (ex .getRootCause ()).isInstanceOf (NoSuchBeanDefinitionException .class );
238
+ assertThat (ex .getBeanName ()).isEqualTo ("autowired" );
239
+ });
236
240
}
237
241
238
242
@ Test
@@ -249,9 +253,10 @@ void autowiredConstructorArgumentWithMultipleNonQualifiedCandidates() {
249
253
context .registerBeanDefinition ("autowired" ,
250
254
new RootBeanDefinition (QualifiedConstructorArgumentTestBean .class ));
251
255
AnnotationConfigUtils .registerAnnotationConfigProcessors (context );
252
- assertThatExceptionOfType (UnsatisfiedDependencyException .class ).isThrownBy (
253
- context ::refresh )
254
- .satisfies (ex -> assertThat (ex .getBeanName ()).isEqualTo ("autowired" ));
256
+
257
+ assertThatExceptionOfType (UnsatisfiedDependencyException .class )
258
+ .isThrownBy (context ::refresh )
259
+ .satisfies (ex -> assertThat (ex .getBeanName ()).isEqualTo ("autowired" ));
255
260
}
256
261
257
262
@ Test
@@ -374,12 +379,13 @@ void autowiredFieldDoesNotResolveCandidateWithDefaultValueAndConflictingValueOnB
374
379
context .registerBeanDefinition ("autowired" ,
375
380
new RootBeanDefinition (QualifiedFieldWithDefaultValueTestBean .class ));
376
381
AnnotationConfigUtils .registerAnnotationConfigProcessors (context );
377
- assertThatExceptionOfType (BeanCreationException .class ).isThrownBy (
378
- context ::refresh )
379
- .satisfies (ex -> {
380
- assertThat (ex .getRootCause ()).isInstanceOf (NoSuchBeanDefinitionException .class );
381
- assertThat (ex .getBeanName ()).isEqualTo ("autowired" );
382
- });
382
+
383
+ assertThatExceptionOfType (BeanCreationException .class )
384
+ .isThrownBy (context ::refresh )
385
+ .satisfies (ex -> {
386
+ assertThat (ex .getRootCause ()).isInstanceOf (NoSuchBeanDefinitionException .class );
387
+ assertThat (ex .getBeanName ()).isEqualTo ("autowired" );
388
+ });
383
389
}
384
390
385
391
@ Test
@@ -451,12 +457,13 @@ void autowiredFieldDoesNotResolveWithMultipleQualifierValuesAndConflictingDefaul
451
457
context .registerBeanDefinition ("autowired" ,
452
458
new RootBeanDefinition (QualifiedFieldWithMultipleAttributesTestBean .class ));
453
459
AnnotationConfigUtils .registerAnnotationConfigProcessors (context );
454
- assertThatExceptionOfType (BeanCreationException .class ).isThrownBy (
455
- context ::refresh )
456
- .satisfies (ex -> {
457
- assertThat (ex .getRootCause ()).isInstanceOf (NoSuchBeanDefinitionException .class );
458
- assertThat (ex .getBeanName ()).isEqualTo ("autowired" );
459
- });
460
+
461
+ assertThatExceptionOfType (BeanCreationException .class )
462
+ .isThrownBy (context ::refresh )
463
+ .satisfies (ex -> {
464
+ assertThat (ex .getRootCause ()).isInstanceOf (NoSuchBeanDefinitionException .class );
465
+ assertThat (ex .getBeanName ()).isEqualTo ("autowired" );
466
+ });
460
467
}
461
468
462
469
@ Test
@@ -507,12 +514,13 @@ void autowiredFieldDoesNotResolveWithMultipleQualifierValuesAndMultipleMatchingC
507
514
context .registerBeanDefinition ("autowired" ,
508
515
new RootBeanDefinition (QualifiedFieldWithMultipleAttributesTestBean .class ));
509
516
AnnotationConfigUtils .registerAnnotationConfigProcessors (context );
510
- assertThatExceptionOfType (BeanCreationException .class ).isThrownBy (
511
- context ::refresh )
512
- .satisfies (ex -> {
513
- assertThat (ex .getRootCause ()).isInstanceOf (NoSuchBeanDefinitionException .class );
514
- assertThat (ex .getBeanName ()).isEqualTo ("autowired" );
515
- });
517
+
518
+ assertThatExceptionOfType (BeanCreationException .class )
519
+ .isThrownBy (context ::refresh )
520
+ .satisfies (ex -> {
521
+ assertThat (ex .getRootCause ()).isInstanceOf (NoSuchBeanDefinitionException .class );
522
+ assertThat (ex .getBeanName ()).isEqualTo ("autowired" );
523
+ });
516
524
}
517
525
518
526
@ Test
@@ -574,9 +582,10 @@ void autowiredFieldDoesNotResolveWithBaseQualifierAndNonDefaultValueAndMultipleM
574
582
context .registerBeanDefinition ("autowired" ,
575
583
new RootBeanDefinition (QualifiedConstructorArgumentWithBaseQualifierNonDefaultValueTestBean .class ));
576
584
AnnotationConfigUtils .registerAnnotationConfigProcessors (context );
577
- assertThatExceptionOfType (UnsatisfiedDependencyException .class ).isThrownBy (
578
- context ::refresh )
579
- .satisfies (ex -> assertThat (ex .getBeanName ()).isEqualTo ("autowired" ));
585
+
586
+ assertThatExceptionOfType (UnsatisfiedDependencyException .class )
587
+ .isThrownBy (context ::refresh )
588
+ .satisfies (ex -> assertThat (ex .getBeanName ()).isEqualTo ("autowired" ));
580
589
}
581
590
582
591
@@ -752,7 +761,7 @@ public DefaultValueQualifiedPerson(String name) {
752
761
@ Qualifier
753
762
@interface TestQualifierWithMultipleAttributes {
754
763
755
- String value () default "default" ;
764
+ String [] value () default "default" ;
756
765
757
766
int number ();
758
767
}
0 commit comments