Created
November 8, 2012 17:00
-
-
Save hertzsprung/4040071 to your computer and use it in GitHub Desktop.
Spring Java configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RunWith(SpringJUnit4ClassRunner.class) | |
@ContextConfiguration(classes=BeanTest.Config.class) | |
public class BeanTest { | |
@Test | |
public void test() {} | |
@Configuration | |
public static class Config { | |
@Bean public Object bean1() { | |
System.out.println(bean2()); | |
System.out.println(bean2()); | |
return new Object(); | |
} | |
@Bean public Object bean2() { | |
return new Object(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment