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 {

    @Test
    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());
            }
        }

    }

}
