Jaycean commented on a change in pull request #1436:
URL: https://github.com/apache/apisix-dashboard/pull/1436#discussion_r571738713
##########
File path: api/internal/handler/ssl/ssl_test.go
##########
@@ -19,146 +19,859 @@ package ssl
import (
"encoding/json"
+ "errors"
+ "fmt"
+ "io/ioutil"
+ "net/http"
"testing"
- "time"
"github.com/shiningrush/droplet"
+ "github.com/shiningrush/droplet/data"
"github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/mock"
- "github.com/apisix/manager-api/internal/conf"
"github.com/apisix/manager-api/internal/core/entity"
- "github.com/apisix/manager-api/internal/core/storage"
"github.com/apisix/manager-api/internal/core/store"
+ "github.com/apisix/manager-api/internal/handler"
+ "github.com/apisix/manager-api/internal/utils/consts"
)
-func TestSSL(t *testing.T) {
- // init
- err := storage.InitETCDClient(conf.ETCDConfig)
+func getTestKeyCert(t *testing.T) (string, string) {
+ testCert, err := ioutil.ReadFile("../../../test/certs/test2.crt")
assert.Nil(t, err)
- err = store.InitStores()
+ testKey, err := ioutil.ReadFile("../../../test/certs/test2.key")
Review comment:
These two files are also used by E2E test. In order not to create data
repeatedly, I directly use the key and cert files.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]