4 ms·
It's trivial to observe runtime behavior with a debugger. If you use constructor injection as it is recommended, just add a breakpoint in the constructor and s
by andor 6y ago
It's trivial to observe runtime behavior with a debugger.
If you use constructor injection as it is recommended, just add a breakpoint in the constructor and start the app in the debugger.
@Component
public class Foo {
public Foo(Bar bar) {
// breakpoint here
}
}
Edit:
In most cases it should be obvious what is getting injected, e.g. in the example Bar is another component/bean that was manually created. If you have two beans of the same type, use a qualifier to specify which one you want.
If you are having issues with unexpected things being injected, I'd recommend setting up a few tests that establish that your app is properly wired up.