Files
EdgeAPI/internal/db/models/ssl_cert_dao_test.go

20 lines
539 B
Go
Raw Normal View History

2022-03-18 17:08:51 +08:00
package models_test
2020-09-30 17:46:43 +08:00
import (
2022-03-18 17:08:51 +08:00
"github.com/TeaOSLab/EdgeAPI/internal/db/models"
2020-09-30 17:46:43 +08:00
_ "github.com/go-sql-driver/mysql"
2022-03-18 17:08:51 +08:00
timeutil "github.com/iwind/TeaGo/utils/time"
"testing"
2020-09-30 17:46:43 +08:00
)
2022-03-18 17:08:51 +08:00
func TestSSLCertDAO_ListCertsToUpdateOCSP(t *testing.T) {
var dao = models.NewSSLCertDAO()
certs, err := dao.ListCertsToUpdateOCSP(nil, 3600, 10)
if err != nil {
t.Fatal(err)
}
for _, cert := range certs {
t.Log(cert.Id, cert.Name, "updatedAt:", cert.OcspUpdatedAt, timeutil.FormatTime("Y-m-d H:i:s", int64(cert.OcspUpdatedAt)), cert.OcspIsUpdated)
}
}