0

I wonder when environment method is being taken into account.

Considering following code:

bean { Bar(ref()) } // requires bean of type Foo
environment(
    { !activeProfiles.contains("local") },
    { ProdFoo() }))
environment(
    { activeProfiles.contains("local") },
    { bean<LocalFoo>() })

Sometimes I observed errors related with no bean of type Foo. Does it mean that environment is not evaluated as one of the first expressions?

pixel
  • 24,905
  • 36
  • 149
  • 251

1 Answers1

0

The answer is plain simple - I've forgot to wrap ProdFoo() into bean{ ... }

pixel
  • 24,905
  • 36
  • 149
  • 251