Fix tests for Gorestful.

This commit is contained in:
Max Schaefer
2020-08-24 17:04:31 +01:00
parent a0a8a584a4
commit 149ceda636
5 changed files with 243 additions and 21 deletions

View File

@@ -1,14 +1,14 @@
| gorestful.go:13:15:13:47 | index expression | gorestful.go:13:15:13:44 | call to QueryParameters : slice type | gorestful.go:13:15:13:47 | index expression | This command depends on $@. | gorestful.go:13:15:13:44 | call to QueryParameters | a user-provided value |
| gorestful.go:14:15:14:43 | call to QueryParameter | gorestful.go:14:15:14:43 | call to QueryParameter | gorestful.go:14:15:14:43 | call to QueryParameter | This command depends on $@. | gorestful.go:14:15:14:43 | call to QueryParameter | a user-provided value |
| gorestful.go:16:15:16:17 | val | gorestful.go:15:12:15:39 | call to BodyParameter : tuple type | gorestful.go:16:15:16:17 | val | This command depends on $@. | gorestful.go:15:12:15:39 | call to BodyParameter | a user-provided value |
| gorestful.go:17:15:17:44 | call to HeaderParameter | gorestful.go:17:15:17:44 | call to HeaderParameter | gorestful.go:17:15:17:44 | call to HeaderParameter | This command depends on $@. | gorestful.go:17:15:17:44 | call to HeaderParameter | a user-provided value |
| gorestful.go:18:15:18:42 | call to PathParameter | gorestful.go:18:15:18:42 | call to PathParameter | gorestful.go:18:15:18:42 | call to PathParameter | This command depends on $@. | gorestful.go:18:15:18:42 | call to PathParameter | a user-provided value |
| gorestful.go:19:15:19:45 | index expression | gorestful.go:19:15:19:38 | call to PathParameters : map type | gorestful.go:19:15:19:45 | index expression | This command depends on $@. | gorestful.go:19:15:19:38 | call to PathParameters | a user-provided value |
| gorestful.go:22:15:22:21 | selection of cmd | gorestful.go:21:21:21:24 | &... : pointer type | gorestful.go:22:15:22:21 | selection of cmd | This command depends on $@. | gorestful.go:21:21:21:24 | &... | a user-provided value |
| gorestful_v2.go:13:15:13:47 | index expression | gorestful_v2.go:13:15:13:44 | call to QueryParameters : slice type | gorestful_v2.go:13:15:13:47 | index expression | This command depends on $@. | gorestful_v2.go:13:15:13:44 | call to QueryParameters | a user-provided value |
| gorestful_v2.go:14:15:14:43 | call to QueryParameter | gorestful_v2.go:14:15:14:43 | call to QueryParameter | gorestful_v2.go:14:15:14:43 | call to QueryParameter | This command depends on $@. | gorestful_v2.go:14:15:14:43 | call to QueryParameter | a user-provided value |
| gorestful_v2.go:16:15:16:17 | val | gorestful_v2.go:15:12:15:39 | call to BodyParameter : tuple type | gorestful_v2.go:16:15:16:17 | val | This command depends on $@. | gorestful_v2.go:15:12:15:39 | call to BodyParameter | a user-provided value |
| gorestful_v2.go:17:15:17:44 | call to HeaderParameter | gorestful_v2.go:17:15:17:44 | call to HeaderParameter | gorestful_v2.go:17:15:17:44 | call to HeaderParameter | This command depends on $@. | gorestful_v2.go:17:15:17:44 | call to HeaderParameter | a user-provided value |
| gorestful_v2.go:18:15:18:42 | call to PathParameter | gorestful_v2.go:18:15:18:42 | call to PathParameter | gorestful_v2.go:18:15:18:42 | call to PathParameter | This command depends on $@. | gorestful_v2.go:18:15:18:42 | call to PathParameter | a user-provided value |
| gorestful_v2.go:19:15:19:45 | index expression | gorestful_v2.go:19:15:19:38 | call to PathParameters : map type | gorestful_v2.go:19:15:19:45 | index expression | This command depends on $@. | gorestful_v2.go:19:15:19:38 | call to PathParameters | a user-provided value |
| gorestful_v2.go:22:15:22:21 | selection of cmd | gorestful_v2.go:21:21:21:24 | &... : pointer type | gorestful_v2.go:22:15:22:21 | selection of cmd | This command depends on $@. | gorestful_v2.go:21:21:21:24 | &... | a user-provided value |
| gorestful.go:15:15:15:47 | index expression | gorestful.go:15:15:15:44 | call to QueryParameters : slice type | gorestful.go:15:15:15:47 | index expression | This command depends on $@. | gorestful.go:15:15:15:44 | call to QueryParameters | a user-provided value |
| gorestful.go:16:15:16:43 | call to QueryParameter | gorestful.go:16:15:16:43 | call to QueryParameter | gorestful.go:16:15:16:43 | call to QueryParameter | This command depends on $@. | gorestful.go:16:15:16:43 | call to QueryParameter | a user-provided value |
| gorestful.go:18:15:18:17 | val | gorestful.go:17:12:17:39 | call to BodyParameter : tuple type | gorestful.go:18:15:18:17 | val | This command depends on $@. | gorestful.go:17:12:17:39 | call to BodyParameter | a user-provided value |
| gorestful.go:19:15:19:44 | call to HeaderParameter | gorestful.go:19:15:19:44 | call to HeaderParameter | gorestful.go:19:15:19:44 | call to HeaderParameter | This command depends on $@. | gorestful.go:19:15:19:44 | call to HeaderParameter | a user-provided value |
| gorestful.go:20:15:20:42 | call to PathParameter | gorestful.go:20:15:20:42 | call to PathParameter | gorestful.go:20:15:20:42 | call to PathParameter | This command depends on $@. | gorestful.go:20:15:20:42 | call to PathParameter | a user-provided value |
| gorestful.go:21:15:21:45 | index expression | gorestful.go:21:15:21:38 | call to PathParameters : map type | gorestful.go:21:15:21:45 | index expression | This command depends on $@. | gorestful.go:21:15:21:38 | call to PathParameters | a user-provided value |
| gorestful.go:24:15:24:21 | selection of cmd | gorestful.go:23:21:23:24 | &... : pointer type | gorestful.go:24:15:24:21 | selection of cmd | This command depends on $@. | gorestful.go:23:21:23:24 | &... | a user-provided value |
| gorestful_v2.go:15:15:15:47 | index expression | gorestful_v2.go:15:15:15:44 | call to QueryParameters : slice type | gorestful_v2.go:15:15:15:47 | index expression | This command depends on $@. | gorestful_v2.go:15:15:15:44 | call to QueryParameters | a user-provided value |
| gorestful_v2.go:16:15:16:43 | call to QueryParameter | gorestful_v2.go:16:15:16:43 | call to QueryParameter | gorestful_v2.go:16:15:16:43 | call to QueryParameter | This command depends on $@. | gorestful_v2.go:16:15:16:43 | call to QueryParameter | a user-provided value |
| gorestful_v2.go:18:15:18:17 | val | gorestful_v2.go:17:12:17:39 | call to BodyParameter : tuple type | gorestful_v2.go:18:15:18:17 | val | This command depends on $@. | gorestful_v2.go:17:12:17:39 | call to BodyParameter | a user-provided value |
| gorestful_v2.go:19:15:19:44 | call to HeaderParameter | gorestful_v2.go:19:15:19:44 | call to HeaderParameter | gorestful_v2.go:19:15:19:44 | call to HeaderParameter | This command depends on $@. | gorestful_v2.go:19:15:19:44 | call to HeaderParameter | a user-provided value |
| gorestful_v2.go:20:15:20:42 | call to PathParameter | gorestful_v2.go:20:15:20:42 | call to PathParameter | gorestful_v2.go:20:15:20:42 | call to PathParameter | This command depends on $@. | gorestful_v2.go:20:15:20:42 | call to PathParameter | a user-provided value |
| gorestful_v2.go:21:15:21:45 | index expression | gorestful_v2.go:21:15:21:38 | call to PathParameters : map type | gorestful_v2.go:21:15:21:45 | index expression | This command depends on $@. | gorestful_v2.go:21:15:21:38 | call to PathParameters | a user-provided value |
| gorestful_v2.go:24:15:24:21 | selection of cmd | gorestful_v2.go:23:21:23:24 | &... : pointer type | gorestful_v2.go:24:15:24:21 | selection of cmd | This command depends on $@. | gorestful_v2.go:23:21:23:24 | &... | a user-provided value |

View File

@@ -1,5 +1,7 @@
package gorestfultest
//go:generate depstubber -vendor github.com/emicklei/go-restful/v3 Request,Response
import (
restful "github.com/emicklei/go-restful/v3"
"os/exec"

View File

@@ -1,5 +1,7 @@
package gorestfultest
//go:generate depstubber -vendor github.com/emicklei/go-restful Request,Response
import (
restful "github.com/emicklei/go-restful"
"os/exec"

View File

@@ -1,16 +1,23 @@
// Code generated by depstubber. DO NOT EDIT.
// This is a simple stub for github.com/emicklei/go-restful/v3, strictly for use in testing.
// This is a simple stub for github.com/emicklei/go-restful, strictly for use in testing.
// See the LICENSE file for information about the licensing of the original library.
// Source: github.com/emicklei/go-restful/v3 (exports: Request; functions: )
// Source: github.com/emicklei/go-restful (exports: Request,Response; functions: )
// Package gorestfulstub is a stub of github.com/emicklei/go-restful, generated by depstubber.
package gorestfulstub
// Package gopkg is a stub of github.com/emicklei/go-restful, generated by depstubber.
package gopkg
import (
bufio "bufio"
net "net"
http "net/http"
)
type EntityReaderWriter interface {
Read(_ *Request, _ interface{}) error
Write(_ *Response, _ int, _ interface{}) error
}
type Request struct {
Request *http.Request
}
@@ -52,3 +59,105 @@ func (_ *Request) ReadEntity(_ interface{}) error {
}
func (_ *Request) SetAttribute(_ string, _ interface{}) {}
type Response struct {
ResponseWriter http.ResponseWriter
}
func (_ Response) AddHeader(_ string, _ string) Response {
return Response{}
}
func (_ Response) CloseNotify() <-chan bool {
return nil
}
func (_ Response) ContentLength() int {
return 0
}
func (_ Response) Error() error {
return nil
}
func (_ Response) Header() http.Header {
return nil
}
func (_ Response) InternalServerError() Response {
return Response{}
}
func (_ Response) StatusCode() int {
return 0
}
func (_ *Response) EntityWriter() (EntityReaderWriter, bool) {
return nil, false
}
func (_ *Response) Flush() {}
func (_ *Response) Hijack() (net.Conn, *bufio.ReadWriter, error) {
return nil, nil, nil
}
func (_ *Response) PrettyPrint(_ bool) {}
func (_ *Response) SetRequestAccepts(_ string) {}
func (_ *Response) Write(_ []byte) (int, error) {
return 0, nil
}
func (_ *Response) WriteAsJson(_ interface{}) error {
return nil
}
func (_ *Response) WriteAsXml(_ interface{}) error {
return nil
}
func (_ *Response) WriteEntity(_ interface{}) error {
return nil
}
func (_ *Response) WriteError(_ int, _ error) error {
return nil
}
func (_ *Response) WriteErrorString(_ int, _ string) error {
return nil
}
func (_ *Response) WriteHeader(_ int) {}
func (_ *Response) WriteHeaderAndEntity(_ int, _ interface{}) error {
return nil
}
func (_ *Response) WriteHeaderAndJson(_ int, _ interface{}, _ string) error {
return nil
}
func (_ *Response) WriteHeaderAndXml(_ int, _ interface{}) error {
return nil
}
func (_ *Response) WriteJson(_ interface{}, _ string) error {
return nil
}
func (_ *Response) WriteServiceError(_ int, _ ServiceError) error {
return nil
}
type ServiceError struct {
Code int
Message string
Header http.Header
}
func (_ ServiceError) Error() string {
return ""
}

View File

@@ -2,15 +2,22 @@
// This is a simple stub for github.com/emicklei/go-restful/v3, strictly for use in testing.
// See the LICENSE file for information about the licensing of the original library.
// Source: github.com/emicklei/go-restful/v3 (exports: Request; functions: )
// Source: github.com/emicklei/go-restful/v3 (exports: Request,Response; functions: )
// Package gorestfulstub is a stub of github.com/emicklei/go-restful/v3, generated by depstubber.
package gorestfulstub
// Package gopkg is a stub of github.com/emicklei/go-restful/v3, generated by depstubber.
package gopkg
import (
bufio "bufio"
net "net"
http "net/http"
)
type EntityReaderWriter interface {
Read(_ *Request, _ interface{}) error
Write(_ *Response, _ int, _ interface{}) error
}
type Request struct {
Request *http.Request
}
@@ -52,3 +59,105 @@ func (_ *Request) ReadEntity(_ interface{}) error {
}
func (_ *Request) SetAttribute(_ string, _ interface{}) {}
type Response struct {
ResponseWriter http.ResponseWriter
}
func (_ Response) AddHeader(_ string, _ string) Response {
return Response{}
}
func (_ Response) CloseNotify() <-chan bool {
return nil
}
func (_ Response) ContentLength() int {
return 0
}
func (_ Response) Error() error {
return nil
}
func (_ Response) Header() http.Header {
return nil
}
func (_ Response) InternalServerError() Response {
return Response{}
}
func (_ Response) StatusCode() int {
return 0
}
func (_ *Response) EntityWriter() (EntityReaderWriter, bool) {
return nil, false
}
func (_ *Response) Flush() {}
func (_ *Response) Hijack() (net.Conn, *bufio.ReadWriter, error) {
return nil, nil, nil
}
func (_ *Response) PrettyPrint(_ bool) {}
func (_ *Response) SetRequestAccepts(_ string) {}
func (_ *Response) Write(_ []byte) (int, error) {
return 0, nil
}
func (_ *Response) WriteAsJson(_ interface{}) error {
return nil
}
func (_ *Response) WriteAsXml(_ interface{}) error {
return nil
}
func (_ *Response) WriteEntity(_ interface{}) error {
return nil
}
func (_ *Response) WriteError(_ int, _ error) error {
return nil
}
func (_ *Response) WriteErrorString(_ int, _ string) error {
return nil
}
func (_ *Response) WriteHeader(_ int) {}
func (_ *Response) WriteHeaderAndEntity(_ int, _ interface{}) error {
return nil
}
func (_ *Response) WriteHeaderAndJson(_ int, _ interface{}, _ string) error {
return nil
}
func (_ *Response) WriteHeaderAndXml(_ int, _ interface{}) error {
return nil
}
func (_ *Response) WriteJson(_ interface{}, _ string) error {
return nil
}
func (_ *Response) WriteServiceError(_ int, _ ServiceError) error {
return nil
}
type ServiceError struct {
Code int
Message string
Header http.Header
}
func (_ ServiceError) Error() string {
return ""
}