博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Spring测试
阅读量:4228 次
发布时间:2019-05-26

本文共 472 字,大约阅读时间需要 1 分钟。

@RunWith(SpringJUnit4ClassRunner.class)//在Junit环境下提供Spring TestContext Framework的功能@ContextConfiguration(classes = {TestConfig.class})//用来加载ApplicationContext,齐总classes属性用来加载配置类@ActiveProfiles("prod")//用来声明活动的profilepublic class java {    @Autowired    private TestBean testBean;    @Test    public void prodBeanShouldInject(){        String expected="from production profile";        String actual=testBean.getContent();        Assert.assertEquals(expected,actual);    }}

转载地址:http://wljqi.baihongyu.com/

你可能感兴趣的文章
The Project Management Question and Answer Book
查看>>
Special Edition Using Crystal Reports 10
查看>>
SQL: The Complete Reference
查看>>
Advances In Uml And Xml-based Software Evolution
查看>>
Successful Software Reengineering
查看>>
Wireless Network Hacks & Mods For Dummies
查看>>
Programming INDIGO
查看>>
System Analysis, Design, and Development: Concepts, Principles, and Practices
查看>>
How to Run Successful Projects in Web Time
查看>>
Sams Teach Yourself SQL Server(TM) 2005 Express in 24 Hours
查看>>
Beginning Apache Struts: From Novice to Professional
查看>>
Expert Spring MVC and Web Flow (Expert)
查看>>
A Developer's Guide to SQL Server 2005
查看>>
Active Directory Cookbook, 2nd Edition
查看>>
Designing and Developing Scalable IP Networks
查看>>
Bluetooth Demystified
查看>>
SWT (Developer's Notebook)
查看>>
Java 2: The Complete Reference, Fifth Edition
查看>>
Java Programming on Linux
查看>>
Microsoft Access VBA Programming for the Absolute Beginner, Second Edition
查看>>