@@ -1370,10 +1370,10 @@ void autowireWithTwoMatchesForConstructorDependency() {
1370
1370
lbf .registerBeanDefinition ("rod2" , bd2 );
1371
1371
lbf .setParameterNameDiscoverer (new DefaultParameterNameDiscoverer ());
1372
1372
1373
- assertThatExceptionOfType (UnsatisfiedDependencyException .class ). isThrownBy (() ->
1374
- lbf .autowire (ConstructorDependency .class , AutowireCapableBeanFactory .AUTOWIRE_CONSTRUCTOR , false ))
1375
- .withMessageContaining ("rod" )
1376
- .withMessageContaining ("rod2" );
1373
+ assertThatExceptionOfType (UnsatisfiedDependencyException .class )
1374
+ . isThrownBy (() -> lbf .autowire (ConstructorDependency .class , AutowireCapableBeanFactory .AUTOWIRE_CONSTRUCTOR , false ))
1375
+ .withMessageContaining ("rod" )
1376
+ .withMessageContaining ("rod2" );
1377
1377
}
1378
1378
1379
1379
@ Test
@@ -1441,11 +1441,11 @@ void dependsOnCycle() {
1441
1441
bd2 .setDependsOn ("tb1" );
1442
1442
lbf .registerBeanDefinition ("tb2" , bd2 );
1443
1443
1444
- assertThatExceptionOfType (BeanCreationException .class ). isThrownBy (() ->
1445
- lbf .preInstantiateSingletons ())
1446
- .withMessageContaining ("Circular" )
1447
- .withMessageContaining ("'tb2'" )
1448
- .withMessageContaining ("'tb1'" );
1444
+ assertThatExceptionOfType (BeanCreationException .class )
1445
+ . isThrownBy (() -> lbf .preInstantiateSingletons ())
1446
+ .withMessageContaining ("Circular" )
1447
+ .withMessageContaining ("'tb2'" )
1448
+ .withMessageContaining ("'tb1'" );
1449
1449
}
1450
1450
1451
1451
@ Test
@@ -1460,11 +1460,11 @@ void implicitDependsOnCycle() {
1460
1460
bd3 .setDependsOn ("tb1" );
1461
1461
lbf .registerBeanDefinition ("tb3" , bd3 );
1462
1462
1463
- assertThatExceptionOfType (BeanCreationException .class ). isThrownBy (
1464
- lbf ::preInstantiateSingletons )
1465
- .withMessageContaining ("Circular" )
1466
- .withMessageContaining ("'tb3'" )
1467
- .withMessageContaining ("'tb1'" );
1463
+ assertThatExceptionOfType (BeanCreationException .class )
1464
+ . isThrownBy ( lbf ::preInstantiateSingletons )
1465
+ .withMessageContaining ("Circular" )
1466
+ .withMessageContaining ("'tb3'" )
1467
+ .withMessageContaining ("'tb1'" );
1468
1468
}
1469
1469
1470
1470
@ Test
@@ -1607,10 +1607,10 @@ void getBeanByTypeWithMultiplePriority() {
1607
1607
lbf .registerBeanDefinition ("bd1" , bd1 );
1608
1608
lbf .registerBeanDefinition ("bd2" , bd2 );
1609
1609
1610
- assertThatExceptionOfType (NoUniqueBeanDefinitionException .class ). isThrownBy (() ->
1611
- lbf .getBean (TestBean .class ))
1612
- .withMessageContaining ("Multiple beans found with the same priority" )
1613
- .withMessageContaining ("5" ); // conflicting priority
1610
+ assertThatExceptionOfType (NoUniqueBeanDefinitionException .class )
1611
+ . isThrownBy (() -> lbf .getBean (TestBean .class ))
1612
+ .withMessageContaining ("Multiple beans found with the same priority" )
1613
+ .withMessageContaining ("5" ); // conflicting priority
1614
1614
}
1615
1615
1616
1616
@ Test
@@ -1815,9 +1815,9 @@ void getBeanByTypeInstanceWithMultiplePrimary() {
1815
1815
lbf .registerBeanDefinition ("bd1" , bd1 );
1816
1816
lbf .registerBeanDefinition ("bd2" , bd2 );
1817
1817
1818
- assertThatExceptionOfType (NoUniqueBeanDefinitionException .class ). isThrownBy (() ->
1819
- lbf .getBean (ConstructorDependency .class , 42 ))
1820
- .withMessageContaining ("more than one 'primary'" );
1818
+ assertThatExceptionOfType (NoUniqueBeanDefinitionException .class )
1819
+ . isThrownBy (() -> lbf .getBean (ConstructorDependency .class , 42 ))
1820
+ .withMessageContaining ("more than one 'primary'" );
1821
1821
}
1822
1822
1823
1823
@ Test
@@ -2004,10 +2004,10 @@ void autowireBeanByTypeWithTwoMatches() {
2004
2004
lbf .registerBeanDefinition ("test" , bd );
2005
2005
lbf .registerBeanDefinition ("spouse" , bd2 );
2006
2006
2007
- assertThatExceptionOfType (UnsatisfiedDependencyException .class ). isThrownBy (() ->
2008
- lbf .autowire (DependenciesBean .class , AutowireCapableBeanFactory .AUTOWIRE_BY_TYPE , true ))
2009
- .withMessageContaining ("test" )
2010
- .withMessageContaining ("spouse" );
2007
+ assertThatExceptionOfType (UnsatisfiedDependencyException .class )
2008
+ . isThrownBy (() -> lbf .autowire (DependenciesBean .class , AutowireCapableBeanFactory .AUTOWIRE_BY_TYPE , true ))
2009
+ .withMessageContaining ("test" )
2010
+ .withMessageContaining ("spouse" );
2011
2011
}
2012
2012
2013
2013
@ Test
@@ -2071,10 +2071,10 @@ void autowireBeanByTypeWithIdenticalPriorityCandidates() {
2071
2071
lbf .registerBeanDefinition ("test" , bd );
2072
2072
lbf .registerBeanDefinition ("spouse" , bd2 );
2073
2073
2074
- assertThatExceptionOfType (UnsatisfiedDependencyException .class ). isThrownBy (() ->
2075
- lbf .autowire (DependenciesBean .class , AutowireCapableBeanFactory .AUTOWIRE_BY_TYPE , true ))
2076
- .withCauseExactlyInstanceOf (NoUniqueBeanDefinitionException .class )
2077
- .withMessageContaining ("5" );
2074
+ assertThatExceptionOfType (UnsatisfiedDependencyException .class )
2075
+ . isThrownBy (() -> lbf .autowire (DependenciesBean .class , AutowireCapableBeanFactory .AUTOWIRE_BY_TYPE , true ))
2076
+ .withCauseExactlyInstanceOf (NoUniqueBeanDefinitionException .class )
2077
+ .withMessageContaining ("5" );
2078
2078
}
2079
2079
2080
2080
@ Test
@@ -2337,20 +2337,20 @@ void constructorDependencyWithUnresolvableClass() {
2337
2337
void beanDefinitionWithInterface () {
2338
2338
lbf .registerBeanDefinition ("test" , new RootBeanDefinition (ITestBean .class ));
2339
2339
2340
- assertThatExceptionOfType (BeanCreationException .class ). isThrownBy (() ->
2341
- lbf .getBean ("test" ))
2342
- .withMessageContaining ("interface" )
2343
- .satisfies (ex -> assertThat (ex .getBeanName ()).isEqualTo ("test" ));
2340
+ assertThatExceptionOfType (BeanCreationException .class )
2341
+ . isThrownBy (() -> lbf .getBean ("test" ))
2342
+ .withMessageContaining ("interface" )
2343
+ .satisfies (ex -> assertThat (ex .getBeanName ()).isEqualTo ("test" ));
2344
2344
}
2345
2345
2346
2346
@ Test
2347
2347
void beanDefinitionWithAbstractClass () {
2348
2348
lbf .registerBeanDefinition ("test" , new RootBeanDefinition (AbstractBeanFactory .class ));
2349
2349
2350
- assertThatExceptionOfType (BeanCreationException .class ). isThrownBy (() ->
2351
- lbf .getBean ("test" ))
2352
- .withMessageContaining ("abstract" )
2353
- .satisfies (ex -> assertThat (ex .getBeanName ()).isEqualTo ("test" ));
2350
+ assertThatExceptionOfType (BeanCreationException .class )
2351
+ . isThrownBy (() -> lbf .getBean ("test" ))
2352
+ .withMessageContaining ("abstract" )
2353
+ .satisfies (ex -> assertThat (ex .getBeanName ()).isEqualTo ("test" ));
2354
2354
}
2355
2355
2356
2356
@ Test
0 commit comments