diff --git a/hrp/internal/version/VERSION b/hrp/internal/version/VERSION
index 77ffe6e2..0270bcab 100644
--- a/hrp/internal/version/VERSION
+++ b/hrp/internal/version/VERSION
@@ -1 +1 @@
-v5.0.0+2411092105
+v5.0.0+2411092158
diff --git a/hrp/response_test.go b/hrp/response_test.go
deleted file mode 100644
index b4ef964d..00000000
--- a/hrp/response_test.go
+++ /dev/null
@@ -1,77 +0,0 @@
-package hrp
-
-import (
- "io"
- "net/http"
- "strings"
- "testing"
-
- "github.com/stretchr/testify/assert"
-)
-
-func TestSearchJmespath(t *testing.T) {
- testText := `{"a": {"b": "foo"}, "c": "bar", "d": {"e": [{"f": "foo"}, {"f": "bar"}]}}`
- testData := []struct {
- raw string
- expected string
- }{
- {"body.a.b", "foo"},
- {"body.c", "bar"},
- {"body.d.e[0].f", "foo"},
- {"body.d.e[1].f", "bar"},
- }
- resp := http.Response{}
- resp.Body = io.NopCloser(strings.NewReader(testText))
- respObj, err := newHttpResponseObject(t, newParser(), &resp)
- if err != nil {
- t.Fatal()
- }
- for _, data := range testData {
- if !assert.Equal(t, data.expected, respObj.searchJmespath(data.raw)) {
- t.Fatal()
- }
- }
-}
-
-func TestSearchRegexp(t *testing.T) {
- testText := `
-
-`
- testData := []struct {
- raw string
- expected string
- }{
- {"/user/signOut\">(.*)", "Sign Out"},
- {"", "Leo"},
- }
- // new response object
- resp := http.Response{}
- resp.Body = io.NopCloser(strings.NewReader(testText))
- respObj, err := newHttpResponseObject(t, newParser(), &resp)
- if err != nil {
- t.Fatal()
- }
- for _, data := range testData {
- if !assert.Equal(t, data.expected, respObj.searchRegexp(data.raw)) {
- t.Fatal()
- }
- }
-}
diff --git a/hrp/response.go b/hrp/step_request_response.go
similarity index 100%
rename from hrp/response.go
rename to hrp/step_request_response.go
diff --git a/hrp/step_request_test.go b/hrp/step_request_test.go
index 8795ee1a..4648d0a8 100644
--- a/hrp/step_request_test.go
+++ b/hrp/step_request_test.go
@@ -1,6 +1,9 @@
package hrp
import (
+ "io"
+ "net/http"
+ "strings"
"testing"
"time"
@@ -212,3 +215,70 @@ func TestRunCaseWithTimeout(t *testing.T) {
t.FailNow()
}
}
+
+func TestSearchJmespath(t *testing.T) {
+ testText := `{"a": {"b": "foo"}, "c": "bar", "d": {"e": [{"f": "foo"}, {"f": "bar"}]}}`
+ testData := []struct {
+ raw string
+ expected string
+ }{
+ {"body.a.b", "foo"},
+ {"body.c", "bar"},
+ {"body.d.e[0].f", "foo"},
+ {"body.d.e[1].f", "bar"},
+ }
+ resp := http.Response{}
+ resp.Body = io.NopCloser(strings.NewReader(testText))
+ respObj, err := newHttpResponseObject(t, newParser(), &resp)
+ if err != nil {
+ t.Fatal()
+ }
+ for _, data := range testData {
+ if !assert.Equal(t, data.expected, respObj.searchJmespath(data.raw)) {
+ t.Fatal()
+ }
+ }
+}
+
+func TestSearchRegexp(t *testing.T) {
+ testText := `
+
+`
+ testData := []struct {
+ raw string
+ expected string
+ }{
+ {"/user/signOut\">(.*)", "Sign Out"},
+ {"", "Leo"},
+ }
+ // new response object
+ resp := http.Response{}
+ resp.Body = io.NopCloser(strings.NewReader(testText))
+ respObj, err := newHttpResponseObject(t, newParser(), &resp)
+ if err != nil {
+ t.Fatal()
+ }
+ for _, data := range testData {
+ if !assert.Equal(t, data.expected, respObj.searchRegexp(data.raw)) {
+ t.Fatal()
+ }
+ }
+}