@@ -3048,6 +3048,7 @@ func TestLogLogger(t *testing.T) {
30483048
30493049type testFoo struct {
30503050 prefix string
3051+ name string
30513052}
30523053
30533054type testBar struct {
@@ -3070,12 +3071,12 @@ func (tac *testAutoConfiguration) NewEmpty() *BeanDefinition {
30703071 return NewBean (new (struct {})).Name ("empty" )
30713072}
30723073
3073- func (tac * testAutoConfiguration ) newFoo () * testFoo {
3074- return & testFoo {prefix : tac .Prefix }
3074+ func (tac * testAutoConfiguration ) newFoo (name string ) * testFoo {
3075+ return & testFoo {prefix : tac .Prefix , name : name }
30753076}
30763077
30773078func (tac * testAutoConfiguration ) NewFoo () * BeanDefinition {
3078- return NewBean (tac .newFoo )
3079+ return NewBean (tac .newFoo , "${name}" )
30793080}
30803081
30813082func (tac * testAutoConfiguration ) NewBar (foo * testFoo ) (* testBar , error ) {
@@ -3097,6 +3098,7 @@ func TestConfiguration(t *testing.T) {
30973098 p := conf .New ()
30983099 p .Set ("prefix" , "hello" )
30993100 p .Set ("open" , "true" )
3101+ p .Set ("name" , "go-spring" )
31003102
31013103 err := c .Properties ().Refresh (p )
31023104 assert .Nil (t , err )
@@ -3109,6 +3111,7 @@ func TestConfiguration(t *testing.T) {
31093111
31103112 subject := bd .Interface ().(* testConfiguration )
31113113 assert .Equal (t , subject .Subject .Bar .foo .prefix , "hello" )
3114+ assert .Equal (t , subject .Subject .Bar .foo .name , "go-spring" )
31123115 })
31133116
31143117 t .Run ("test Configuration with conditional" , func (t * testing.T ) {
@@ -3118,6 +3121,7 @@ func TestConfiguration(t *testing.T) {
31183121 p .Set ("prefix" , "hello" )
31193122 p .Set ("open" , "true" )
31203123 p .Set ("enable" , "false" )
3124+ p .Set ("name" , "go-spring" )
31213125
31223126 err := c .Properties ().Refresh (p )
31233127 assert .Nil (t , err )
0 commit comments