Skip to content

Commit c7c0ae1

Browse files
author
wisinghe
committed
limit decision log verification to the success case
Signed-off-by: wisinghe <[email protected]>
1 parent 4f53ab4 commit c7c0ae1

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

filters/openpolicyagent/opaauthorizerequest/opaauthorizerequest_test.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -682,12 +682,11 @@ func TestAuthorizeRequestFilterWithS3DecisionLogPlugin(t *testing.T) {
682682
defer clientServer.Close()
683683

684684
s3Server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
685-
// Verify request details
686-
t.Logf("Uploading to S3 at path: %s", r.URL.Path)
687-
body, _ := io.ReadAll(r.Body)
688-
assertDecisionLogJSON(t, body)
689-
690685
if strings.Contains(r.URL.Path, "logs-success") {
686+
// Verify request details
687+
t.Logf("Uploading to S3 at path: %s", r.URL.Path)
688+
body, _ := io.ReadAll(r.Body)
689+
assertDecisionLogJSON(t, body)
691690
w.WriteHeader(http.StatusOK)
692691
} else if strings.Contains(r.URL.Path, "logs-forbidden") {
693692
w.WriteHeader(http.StatusForbidden)

0 commit comments

Comments
 (0)