Documentation ¶
Index ¶
- Variables
- func FindAvailTCPPort() int
- func FindInputsByHTML(body io.Reader) (map[string]string, error)
- func FindRequestObjectByHTML(body io.Reader) (string, error)
- func ImplicitClientRequestObject(t *testing.T, values map[string]interface{}) string
- func MakeConfig() *config.Config
- func MakeRequestObject(t *testing.T, values map[string]interface{}, key string) string
- func MakeTestRouter() *gin.Engine
- func MakeTokenManager() (token.Manager, error)
- func MustParseQuery(q string) url.Values
- func MustParseURL(u string) *url.URL
- func SomeClientRequestObject(t *testing.T, values map[string]interface{}) string
- type APITestEnvironment
- func (env *APITestEnvironment) Do(method, path, token string, values url.Values) *httptest.ResponseRecorder
- func (env *APITestEnvironment) DoRequest(r *http.Request) *httptest.ResponseRecorder
- func (env *APITestEnvironment) Get(path, token string, query url.Values) *httptest.ResponseRecorder
- func (env *APITestEnvironment) JSONTest(t *testing.T, method, endpoint string, tests []JSONTest)
- func (env *APITestEnvironment) Post(path, token string, body url.Values) *httptest.ResponseRecorder
- func (env *APITestEnvironment) RedirectTest(t *testing.T, method, endpoint string, tests []RedirectTest)
- func (env *APITestEnvironment) Run(ctx context.Context) error
- func (env *APITestEnvironment) ServeRequestURI(t *testing.T) *httptest.Server
- func (env *APITestEnvironment) Start(t *testing.T) (stop func())
- type DummyLDAP
- type DummyUserInfo
- type JSONTest
- type JSONTester
- type ParamsTester
- type RawBody
- type RedirectTest
Constants ¶
This section is empty.
Variables ¶
View Source
var ( SomeClientPublicKey = `` /* 181-byte string literal not displayed */ SomeClientPrivateKey = `` /* 492-byte string literal not displayed */ ImplicitClientPublicKey = `` /* 181-byte string literal not displayed */ ImplicitClientPrivateKey = `` /* 492-byte string literal not displayed */ )
View Source
var ( LDAP = DummyLDAP{ "macrat": DummyUserInfo{ Password: "foobar", Attributes: map[string][]string{ "displayName": {"SHIDA Yuuma"}, "givenName": {"yuuma"}, "sn": {"shida"}, "mail": {"m@crat.jp"}, "telephoneNumber": {"000-1234-5678"}, }, }, "j.smith": DummyUserInfo{ Password: "hello", Attributes: map[string][]string{ "displayName": {"Jhon smith"}, "givenName": {"jhon"}, "sn": {"smith"}, "mail": {"jhon@example.com"}, }, }, } )
Functions ¶
func FindAvailTCPPort ¶
func FindAvailTCPPort() int
func FindRequestObjectByHTML ¶ added in v0.5.0
func ImplicitClientRequestObject ¶ added in v0.5.0
func MakeConfig ¶
func MakeRequestObject ¶ added in v0.5.0
func MakeTestRouter ¶
func MakeTokenManager ¶
func MustParseQuery ¶
func MustParseURL ¶
Types ¶
type APITestEnvironment ¶
func NewAPITestEnvironment ¶
func NewAPITestEnvironment(t *testing.T) *APITestEnvironment
func (*APITestEnvironment) Do ¶
func (env *APITestEnvironment) Do(method, path, token string, values url.Values) *httptest.ResponseRecorder
func (*APITestEnvironment) DoRequest ¶
func (env *APITestEnvironment) DoRequest(r *http.Request) *httptest.ResponseRecorder
func (*APITestEnvironment) Get ¶
func (env *APITestEnvironment) Get(path, token string, query url.Values) *httptest.ResponseRecorder
func (*APITestEnvironment) JSONTest ¶
func (env *APITestEnvironment) JSONTest(t *testing.T, method, endpoint string, tests []JSONTest)
func (*APITestEnvironment) Post ¶
func (env *APITestEnvironment) Post(path, token string, body url.Values) *httptest.ResponseRecorder
func (*APITestEnvironment) RedirectTest ¶
func (env *APITestEnvironment) RedirectTest(t *testing.T, method, endpoint string, tests []RedirectTest)
func (*APITestEnvironment) ServeRequestURI ¶ added in v0.7.0
func (env *APITestEnvironment) ServeRequestURI(t *testing.T) *httptest.Server
func (*APITestEnvironment) Start ¶
func (env *APITestEnvironment) Start(t *testing.T) (stop func())
type DummyUserInfo ¶
type JSONTester ¶
Click to show internal directories.
Click to hide internal directories.