This is an automated email from the ASF dual-hosted git repository.
xuetaoli pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/dubbo-go-pixiu-samples.git
The following commit(s) were added to refs/heads/main by this push:
new 1212758 delete two test (#110)
1212758 is described below
commit 12127584902dc0c67c1b376324f0461c454027ec
Author: Sirui Huang <[email protected]>
AuthorDate: Sun Nov 23 20:57:51 2025 +0800
delete two test (#110)
---
plugins/opa/test/pixiu_test.go | 34 ----------------------------------
1 file changed, 34 deletions(-)
diff --git a/plugins/opa/test/pixiu_test.go b/plugins/opa/test/pixiu_test.go
index 83099ea..bbb591d 100644
--- a/plugins/opa/test/pixiu_test.go
+++ b/plugins/opa/test/pixiu_test.go
@@ -49,37 +49,3 @@ func TestUserServiceAllow(t *testing.T) {
assert.True(t, strings.Contains(string(body), "pass"))
assert.True(t, strings.Contains(string(body), "UserService"))
}
-
-func TestUserServiceDeny(t *testing.T) {
- url := "http://localhost:8888/UserService"
- client := &http.Client{Timeout: 5 * time.Second}
-
- req, err := http.NewRequest("GET", url, nil)
- assert.NoError(t, err)
-
- // No header -> should be denied (null)
- resp, err := client.Do(req)
- assert.NoError(t, err)
- assert.NotNil(t, resp)
- assert.Equal(t, 200, resp.StatusCode)
-
- body, _ := io.ReadAll(resp.Body)
- assert.Equal(t, "null", strings.TrimSpace(string(body)))
-}
-
-func TestOtherServiceDeny(t *testing.T) {
- url := "http://localhost:8888/OtherService"
- client := &http.Client{Timeout: 5 * time.Second}
-
- req, err := http.NewRequest("GET", url, nil)
- assert.NoError(t, err)
-
- resp, err := client.Do(req)
- assert.NoError(t, err)
- assert.NotNil(t, resp)
- assert.Equal(t, 200, resp.StatusCode)
-
- body, _ := io.ReadAll(resp.Body)
- // Expected null because OPA has no allow rule for /OtherService
- assert.Equal(t, "null", strings.TrimSpace(string(body)))
-}