GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — 整合MyBatis · feihugis/SpringBoot-Learning@ae68a47

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • Chapter3-2-7/src/test/java/com/didispace
    • ApplicationTests.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Chapter3-2-7/src/test/java/com/didispace/ApplicationTests.java‎

Copy file name to clipboard
+31-30Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
1-
package com.didispace;
2-
3-
import com.didispace.domain.User;
4-
import com.didispace.domain.UserMapper;
5-
import org.junit.Assert;
6-
import org.junit.Before;
7-
import org.junit.Test;
8-
import org.junit.runner.RunWith;
9-
import org.springframework.beans.factory.annotation.Autowired;
10-
import org.springframework.boot.test.SpringApplicationConfiguration;
11-
import org.springframework.test.annotation.Rollback;
12-
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
13-
14-
15-
@RunWith(SpringJUnit4ClassRunner.class)
16-
@SpringApplicationConfiguration(classes = Application.class)
17-
public class ApplicationTests {
18-
19-
@Autowired
20-
private UserMapper userMapper;
21-
22-
@Test
23-
@Rollback
24-
public void findByName() throws Exception {
25-
userMapper.insert("AAA", 20);
26-
User u = userMapper.findByName("AAA");
27-
Assert.assertEquals(20, u.getAge().intValue());
28-
}
29-
30-
}
1+
package com.didispace;
2+
3+
import com.didispace.domain.User;
4+
import com.didispace.domain.UserMapper;
5+
import org.junit.Assert;
6+
import org.junit.Before;
7+
import org.junit.Test;
8+
import org.junit.runner.RunWith;
9+
import org.springframework.beans.factory.annotation.Autowired;
10+
import org.springframework.boot.test.SpringApplicationConfiguration;
11+
import org.springframework.test.annotation.Rollback;
12+
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
13+
14+
15+
@RunWith(SpringJUnit4ClassRunner.class)
16+
@SpringApplicationConfiguration(classes = Application.class)
17+
@Transactional
18+
public class ApplicationTests {
19+
20+
@Autowired
21+
private UserMapper userMapper;
22+
23+
@Test
24+
@Rollback
25+
public void findByName() throws Exception {
26+
userMapper.insert("AAA", 20);
27+
User u = userMapper.findByName("AAA");
28+
Assert.assertEquals(20, u.getAge().intValue());
29+
}
30+
31+
}

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.