Compare commits
2 Commits
26c0c3ccf0
...
8ff26ff435
Author | SHA1 | Date |
---|---|---|
|
8ff26ff435 | |
|
3fe45e561e |
5
pom.xml
5
pom.xml
|
@ -103,6 +103,11 @@
|
|||
<artifactId>FastInfoset</artifactId>
|
||||
<version>1.2.18</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<repositories>
|
||||
|
|
|
@ -3,9 +3,9 @@ server:
|
|||
spring:
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://localhost:3306/electronic_mall?serverTimezone=GMT%2b8&userSSL=false&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: 'root'
|
||||
url: jdbc:mysql://139.196.201.231:3306/mall?serverTimezone=GMT%2b8&userSSL=false&allowPublicKeyRetrieval=true
|
||||
username: "myuser"
|
||||
password: 'Fzhang5.'
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 30MB
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
package com.rabbiter.em.mapper;
|
||||
|
||||
import com.rabbiter.em.entity.Cart;
|
||||
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.junit4.SpringRunner;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
public class CartMapperTest {
|
||||
@Autowired
|
||||
private CartMapper cartMapper;
|
||||
|
||||
@Test
|
||||
public void selectByUserId() {
|
||||
List<Map<String, Object>> list = cartMapper.selectByUserId(2L);
|
||||
System.out.println(list);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void selectAll() {
|
||||
cartMapper.selectList(null).forEach(System.out::println);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue