Skip to content

Commit 18c9da2

Browse files
committed
[test] Fixing tests
1 parent 30e4743 commit 18c9da2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pkg/service/auth_pipeline_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,10 @@ func TestAuthPipelineGetAuthorizationJSON(t *testing.T) {
316316
}, &requestMock)
317317

318318
requestJSON, _ := gojson.Marshal(requestMock.GetAttributes())
319-
expectedWellKnownAttributes := `"request":{"host":"my-api","method":"GET","path":"/operation","url_path":"/operation","headers":{"authorization":"Bearer n3ex87bye9238ry8"}},"source":{"address":"\u003cnil\u003e"},"destination":{"address":"\u003cnil\u003e"},"auth":{}`
319+
expectedWellKnownAttributes := `"request":{"host":"my-api","method":"GET","path":"/operation","url_path":"/operation","headers":{"authorization":"Bearer n3ex87bye9238ry8"}},"source":{},"destination":{},"auth":{}`
320320
expectedJSON := fmt.Sprintf(`{"context":%s,%s}`, requestJSON, expectedWellKnownAttributes)
321-
assert.Equal(t, pipeline.GetAuthorizationJSON(), expectedJSON)
321+
322+
assert.Equal(t, expectedJSON, pipeline.GetAuthorizationJSON())
322323
}
323324

324325
func TestEvaluateWithCustomDenyOptions(t *testing.T) {
@@ -588,7 +589,7 @@ func TestNewAuthorizationJSON(t *testing.T) {
588589
"credential": "multipass",
589590
},
590591
}
591-
expectedAuthJSON := `{"context":{"request":{"http":{"method":"GET","headers":{"authorization":"Bearer n3ex87bye9238ry8"},"path":"/operation","host":"my-api"}}},"request":{"host":"my-api","method":"GET","path":"/operation","url_path":"/operation","headers":{"authorization":"Bearer n3ex87bye9238ry8"}},"source":{"address":"\u003cnil\u003e"},"destination":{"address":"\u003cnil\u003e"},"auth":{"identity":"leeloo","authorization":{"credential":"multipass"}}}`
592+
expectedAuthJSON := `{"context":{"request":{"http":{"method":"GET","headers":{"authorization":"Bearer n3ex87bye9238ry8"},"path":"/operation","host":"my-api"}}},"request":{"host":"my-api","method":"GET","path":"/operation","url_path":"/operation","headers":{"authorization":"Bearer n3ex87bye9238ry8"}},"source":{},"destination":{},"auth":{"identity":"leeloo","authorization":{"credential":"multipass"}}}`
592593

593594
assert.Equal(t, expectedAuthJSON, NewAuthorizationJSON(request, authPipeline))
594595
}

0 commit comments

Comments
 (0)