SprintBoot单元测试

 

 

AuthTests 

 

package com.mooc.house.web;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.test.context.junit4.SpringRunner;

import com.mooc.house.biz.service.UserService;
import com.mooc.house.common.model.User;

@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment=WebEnvironment.DEFINED_PORT)
public class AuthTests {

	@Autowired
	private UserService userService;

	@Test
	public void testAuth() {
	  User user =	userService.auth("shenzhen_zsw@163.com", "888888");
	  assert user != null;
	  System.out.println("===========" + user.getAboutme());
	}

}

 

上一篇:day14 七牛云上传 ssm框架 图片上传


下一篇:004 使用scrapy框架爬虫