Skip to content
This repository was archived by the owner on Apr 24, 2025. It is now read-only.
This repository was archived by the owner on Apr 24, 2025. It is now read-only.

test framework: Mock DispatchHttpCall to return error #260

@rodrigovc

Description

@rodrigovc

I am doing unit tests for my filter with DispatchHttp, something like this:


_, err = proxywasm.DispatchHttpCall(ctx.clusterName, headers, body, nil, ctx.timeout, ctx.callback)
	if err != nil {
		proxywasm.LogCriticalf("big error: %v", err)
		proxywasm.ResumeHttpRequest()
		return types.ActionContinue
	}

I don't know of a way to mock the DispatchHttpCall method in order to return an error so we can cover this part of the code.

Is there any way of doing this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions