Skip to content

Commit

Permalink
fixed two broken unit tests where mse6 v0.5.1 no longer returns a 404…
Browse files Browse the repository at this point in the history
… but 200
  • Loading branch information
simonmittag committed Jun 2, 2023
1 parent 24c3ded commit 239ff14
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion integration/connection/connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func TestConnection_404ResponseClosesDownstreamConnectionUsingHTTP11(t *testing.
defer c.Close()

//step 2 we send headers and terminate HTTP message.
integration.CheckWrite(t, c, "GET /mse6/xyz HTTP/1.1\r\n")
integration.CheckWrite(t, c, "GET /mse6/send?code=404 HTTP/1.1\r\n")
integration.CheckWrite(t, c, "Host: localhost:8080\r\n")
integration.CheckWrite(t, c, "User-Agent: integration\r\n")
integration.CheckWrite(t, c, "Accept: */*\r\n")
Expand Down
12 changes: 6 additions & 6 deletions integration/responsecode/responsecode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"testing"
)

//TODO: once we start supporting max body size, this needs to be revisited. it sends 100 every time right now.
// TODO: once we start supporting max body size, this needs to be revisited. it sends 100 every time right now.
func TestStatusCode100SentFromProxyWithPutIfExpected100Continue(t *testing.T) {
//step 1 we connect to j8a with net.dial
c, err := net.Dial("tcp", ":8080")
Expand Down Expand Up @@ -301,7 +301,7 @@ func TestUploadSmallerMaxBodyAllowed(t *testing.T) {
}
}

//Test normal responses
// Test normal responses
func TestStatusCodeOfProxiedResponses200To226(t *testing.T) {
var wg1 sync.WaitGroup
for i := 200; i <= 226; i++ {
Expand All @@ -315,7 +315,7 @@ func TestStatusCode216OfProxiedResponse(t *testing.T) {
performOneJ8aResponseCodeTest(t, 216, 216, 8080)
}

//Test redirects are mapped through to the calling user agent
// Test redirects are mapped through to the calling user agent
func TestStatusCodeOfProxiedResponses300To308NonRedirected(t *testing.T) {
var wg1 sync.WaitGroup
for i := 300; i <= 308; i++ {
Expand Down Expand Up @@ -361,7 +361,7 @@ func TestStatusCode300SeriesRedirect(t *testing.T) {

func Test404ResponseBodyIsIncluded(t *testing.T) {
client := &http.Client{}
resp, err := client.Get("http://localhost:8080/mse6/xyzd")
resp, err := client.Get("http://localhost:8080/mse6/send?code=404")

if err != nil {
t.Errorf("error connecting to upstream server")
Expand All @@ -388,7 +388,7 @@ func Test404ResponseBodyIsIncluded(t *testing.T) {
}
}

//Test client errors are mapped through to the calling user agent
// Test client errors are mapped through to the calling user agent
func TestStatusCodeOfProxiedResponses400To499(t *testing.T) {
var wg1 sync.WaitGroup
for i := 400; i <= 499; i++ {
Expand All @@ -398,7 +398,7 @@ func TestStatusCodeOfProxiedResponses400To499(t *testing.T) {
wg1.Wait()
}

//Test upstream server errors are re-mapped to 502 bad gateway
// Test upstream server errors are re-mapped to 502 bad gateway
func TestStatusCodeOfProxiedResponses500To599(t *testing.T) {
var wg2 sync.WaitGroup
for i := 500; i <= 599; i++ {
Expand Down

0 comments on commit 239ff14

Please sign in to comment.