Skip to content

Commit

Permalink
编写数据库测试模块
Browse files Browse the repository at this point in the history
  • Loading branch information
suvvm committed Nov 18, 2019
1 parent 77697cc commit c68b5ff
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,34 @@
package qdu.suvvm.onlinesurvey;

import org.junit.jupiter.api.Test;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import qdu.suvvm.onlinesurvey.mapper.TagMapper;
import qdu.suvvm.onlinesurvey.pojo.Tag;

import java.util.List;

@MapperScan(value = "qdu.suvvm.onlinesurvey.mapper")
@SpringBootTest
class OnlinesurveyApplicationTests {

@Autowired
private TagMapper tagMapper;

@Test
void contextLoads() {
}

@Test
public void select() {
Tag t = new Tag();
// t.setId(400000001);
t.setName("秃头");
List<Tag> tags = tagMapper.selectTags(t);
for(Tag tag : tags){
System.out.println(tag.getId() + " " + tag.getName() + " " + tag.getDescription());
}
}

}

0 comments on commit c68b5ff

Please sign in to comment.