Files
EdgeCommon/pkg/serverconfigs/ipconfigs/action_http_test.go
2020-11-11 21:32:11 +08:00

25 lines
430 B
Go

package ipconfigs
import (
"net/http"
"testing"
"time"
)
func TestHTTPAction_Run(t *testing.T) {
action := &HTTPAction{
URL: "http://127.0.0.1:1234/get?hello=world",
Method: http.MethodGet,
Params: map[string]string{"a": "b"},
ParamName: "IP",
}
err := action.Run(&IPItemConfig{
IPFrom: "192.168.1.100",
ExpiredAt: time.Now().Unix() + 3600,
})
if err != nil {
t.Fatal(err)
}
t.Log("ok")
}