package com.nokia.sms.dao;

import java.util.Date;
import java.util.UUID;

import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import com.nokia.sms.pojo.Sms;

@SpringBootTest
public class SmsDaoTest {

    @Autowired
    private SmsDao smsDao;

    @Test
    void testInsert() {
        Sms sms = new Sms();
        sms.setId(UUID.randomUUID().toString());
        sms.setFromSystem("test");
        sms.setPhoneNumbers(new String[] { "13231899751", "15633560090" });
        sms.setContent("测试Dao");
        sms.setScheduleTime(new Date());
        sms.setSmsType("test");
        smsDao.insert(sms);
    }

    @Test
    void testSelectById() {
        String id = "5a138699-347a-4b4d-b5f7-f269290f55dc";
        Sms sms = smsDao.selectById(id);
        System.out.println(sms);
    }
}
