MCPcopy
hub / github.com/ory/hydra / TestWriteAccessError

Function TestWriteAccessError

fosite/access_error_test.go:22–34  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

20)
21
22func TestWriteAccessError(t *testing.T) {
23 f := &Fosite{Config: new(Config)}
24 header := http.Header{}
25 ctrl := gomock.NewController(t)
26 rw := NewMockResponseWriter(ctrl)
27 t.Cleanup(ctrl.Finish)
28
29 rw.EXPECT().Header().AnyTimes().Return(header)
30 rw.EXPECT().WriteHeader(http.StatusBadRequest)
31 rw.EXPECT().Write(gomock.Any())
32
33 f.WriteAccessError(context.Background(), rw, nil, ErrInvalidRequest)
34}
35
36func TestWriteAccessError_RFC6749(t *testing.T) {
37 // https://tools.ietf.org/html/rfc6749#section-5.2

Callers

nothing calls this directly

Calls 6

EXPECTMethod · 0.95
WriteAccessErrorMethod · 0.95
NewMockResponseWriterFunction · 0.85
HeaderMethod · 0.65
WriteHeaderMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected