(t *testing.T)
| 20 | ) |
| 21 | |
| 22 | func 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 | |
| 36 | func TestWriteAccessError_RFC6749(t *testing.T) { |
| 37 | // https://tools.ietf.org/html/rfc6749#section-5.2 |
nothing calls this directly
no test coverage detected