55package exthttpcheck
66
77import (
8+ "net/url"
9+ "sync/atomic"
10+ "testing"
11+ "time"
12+
813 "github.com/google/uuid"
914 "github.com/steadybit/action-kit/go/action_kit_api/v2"
1015 extension_kit "github.com/steadybit/extension-kit"
1116 "github.com/steadybit/extension-kit/extutil"
1217 "github.com/stretchr/testify/assert"
13- "net/url"
14- "sync/atomic"
15- "testing"
16- "time"
1718)
1819
1920func TestAction_Prepare (t * testing.T ) {
@@ -30,19 +31,19 @@ func TestAction_Prepare(t *testing.T) {
3031 name : "Should return config" ,
3132 requestBody : extutil .JsonMangle (action_kit_api.PrepareActionRequestBody {
3233 Config : map [string ]interface {}{
33- "action" : "prepare" ,
34- "duration" : 5000 ,
35- "statusCode" : "200-209" ,
36- "responsesContains " : "test" ,
37- "successRate" : 100 ,
38- "maxConcurrent" : 10 ,
39- "numberOfRequests" : 5 ,
40- "readTimeout" : 5000 ,
41- "body" : "test" ,
42- "url" : "https://steadybit.com" ,
43- "method" : "GET" ,
44- "connectTimeout" : 5000 ,
45- "followRedirects" : true ,
34+ "action" : "prepare" ,
35+ "duration" : 5000 ,
36+ "statusCode" : "200-209" ,
37+ "responsesContain " : "test" ,
38+ "successRate" : 100 ,
39+ "maxConcurrent" : 10 ,
40+ "numberOfRequests" : 5 ,
41+ "readTimeout" : 5000 ,
42+ "body" : "test" ,
43+ "url" : "https://steadybit.com" ,
44+ "method" : "GET" ,
45+ "connectTimeout" : 5000 ,
46+ "followRedirects" : true ,
4647 "headers" : []any {
4748 map [string ]any {"key" : "test" , "value" : "test" },
4849 },
@@ -83,17 +84,17 @@ func TestAction_Prepare(t *testing.T) {
8384 name : "Should return error for missing url" ,
8485 requestBody : extutil .JsonMangle (action_kit_api.PrepareActionRequestBody {
8586 Config : map [string ]interface {}{
86- "action" : "prepare" ,
87- "statusCode" : "200-209" ,
88- "responsesContains " : "test" ,
89- "successRate" : 100 ,
90- "maxConcurrent" : 10 ,
91- "numberOfRequests" : 5 ,
92- "readTimeout" : 5000 ,
93- "body" : "test" ,
94- "method" : "GET" ,
95- "connectTimeout" : 5000 ,
96- "followRedirects" : true ,
87+ "action" : "prepare" ,
88+ "statusCode" : "200-209" ,
89+ "responsesContain " : "test" ,
90+ "successRate" : 100 ,
91+ "maxConcurrent" : 10 ,
92+ "numberOfRequests" : 5 ,
93+ "readTimeout" : 5000 ,
94+ "body" : "test" ,
95+ "method" : "GET" ,
96+ "connectTimeout" : 5000 ,
97+ "followRedirects" : true ,
9798 "headers" : []any {
9899 map [string ]any {"key" : "test" , "value" : "test" },
99100 },
0 commit comments