只需一步,快速开始
微信登录,快人一步
手机号码,快捷登录
签到天数: 1050 天
连续签到: 1 天
[LV.10]测试总司令
@ExtendWith(SpringExtension.class) @ContextConfiguration("classpath:my-spring.xml") public class MyServiceTest { @Autowired private MyService xxx; @Test public void testFind() { xxx.xxx(); } }
//@RunWith(SpringRunner.class) //junit4加上 @SpringBootTest class ApplicationTests { }
<!-- https://mvnrepository.com/artifact/org.testng/testng --> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>7.1.0</version> <scope>test</scope> </dependency>
package com.feng.demo; import org.assertj.core.api.Assertions; import org.testng.annotations.BeforeSuite; import org.testng.annotations.Test; class UserTest { @BeforeSuite static void before(){ } @Test void getResult() { User user = new User(); String result = user.getResult("tom"); Assertions.assertThat(result).isEqualTo("tom\tjunit", result); } @Test void setName() { } }
您需要 登录 才可以下载或查看,没有帐号?(注-册)加入51Testing
使用道具 举报
本版积分规则 发表回复
查看 »
小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 ) 关于我们
GMT+8, 2024-11-23 02:48 , Processed in 0.065427 second(s), 25 queries .
Powered by Discuz! X3.2
© 2001-2024 Comsenz Inc.