提交 caae2434 编写于 作者: 武汉红喜's avatar 武汉红喜

SpringBootTest

上级 6901afe2
package org.hongxi.whatsmars.spring.boot.dao;
import org.hongxi.whatsmars.spring.boot.model.User;
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.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
/**
* Created by shenhongxi on 2018/2/1.
*/
@RunWith(SpringRunner.class)
@SpringBootTest
@ActiveProfiles("dev")
public class UserMapperTest {
@Autowired
private UserMapper userMapper;
@Test
public void insert() {
assert userMapper != null;
User user = new User();
user.setUsername("javahongxi");
user.setNickname("hongxi");
user.setGender(1);
user.setAge(28);
userMapper.insert(user);
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册