Generate dependencies for Spring TestContext Framework

IntelliJ IDEA 10 gives you an easy way of generating bean dependencies for Spring Test Contexts.
Simply hit Alt+Insert in your Spring Test to invoke the “Generate…” popup, select the “Bean dependency…” action to run and choose the beans you like.

IntelliJ IDEA actually runs a live template inside to complete the code generation. It creates @Autowired field and adds @Qualifier if more than one bean of the desired type is configured in test contexts.

In addition, you can try “Add @Qualifier” quick fix for an incorrect @Autowired class members

It runs a live template and generates the @Qualifier annotation.

Try it in IntelliJ IDEA X EAP and let us know what you think.

This entry was posted in New Features and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">