Skip to content

Commit

Permalink
fix(tests): adjust HTTP proxy error message validation
Browse files Browse the repository at this point in the history
Updated test assertion to validate the revised error message for bad gateway scenarios. Ensures alignment with the updated error handling behavior.
  • Loading branch information
ryanbekhen committed Jan 23, 2025
1 parent 2e72156 commit a9b8ba6
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pkg/httpproxy/httpproxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,7 @@ func TestServer_HandleHTTP_ClientDoError(t *testing.T) {

server.ServeHTTP(rr, proxyReq)

// Kode status harus 502: Bad Gateway karena resolve gagal
assert.Equal(t, http.StatusBadGateway, rr.Code)

// Validasi pesan error
assert.Contains(t, rr.Body.String(), "Bad gateway: failed to resolve destination")
assert.Contains(t, rr.Body.String(), "Bad gateway: failed to send request")
})
}

0 comments on commit a9b8ba6

Please sign in to comment.