Spring MVC Junit4 单元測试 JunitTest

it2025-06-05  67

@RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { "/config/spring3/applicationContext.xml" })//启动Spring容器 public class TestISrmVendorService { //注入Spring容器中的Bean @Autowired private ISrmVendorService srmVendorService; @Test public void testHasMatchUser() throws Exception { List<SrmVendor> searchAllVendorList = srmVendorService.searchAllVendorList(); System.out.println(searchAllVendorList.size()+"--------------------------------"); } }

转载于:https://www.cnblogs.com/bhlsheji/p/5360997.html

最新回复(0)