|
@@ -1,13 +1,7 @@
|
|
|
package com.fdkankan.gateway;
|
|
|
|
|
|
-import cn.hutool.core.collection.CollectionUtil;
|
|
|
-import com.fdkankan.gateway.dto.User;
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
-import org.springframework.data.mongodb.core.MongoTemplate;
|
|
|
-
|
|
|
-import java.util.List;
|
|
|
|
|
|
@SpringBootTest
|
|
|
class GatewayApplicationTests {
|
|
@@ -16,19 +10,10 @@ class GatewayApplicationTests {
|
|
|
void contextLoads() {
|
|
|
}
|
|
|
|
|
|
- @Autowired
|
|
|
- private MongoTemplate mongoTemplate;
|
|
|
|
|
|
@Test
|
|
|
public void test (){
|
|
|
|
|
|
- List<User> userList = mongoTemplate.findAll(User.class);
|
|
|
- if(CollectionUtil.isNotEmpty(userList)){
|
|
|
- for (User user : userList) {
|
|
|
- System.out.println(user.toString());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
}
|
|
|
|
|
|
}
|