opensauceryafrica/barf

Implement an interface for testing BARF endpoints

Opened this issue · 0 comments

Here's an example in the case of Go Fiber

    // Setup your request body
    reqBody := ReqData{ SomeData: "something" }
    bodyJson, _ := json.Marshal(&reqBody)
    req := httptest.NewRequest("GET", "/api/v1/endpoint", bytes.NewReader(bodyJson))
    resp, _ := app.Test(req, 10)

    // Check the expected response code
    assert.Equal(t, 200, resp.StatusCode)