You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by ch...@apache.org on 2022/04/18 04:15:22 UTC

[apisix-dashboard] branch feat-support-apisix2.13.0 created (now 39e13b9e)

This is an automated email from the ASF dual-hosted git repository.

chenjunxu pushed a change to branch feat-support-apisix2.13.0
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git


      at 39e13b9e fix backend unit test failed

This branch includes the following new commits:

     new 39e13b9e fix backend unit test failed

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[apisix-dashboard] 01/01: fix backend unit test failed

Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

chenjunxu pushed a commit to branch feat-support-apisix2.13.0
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git

commit 39e13b9e1e2b997dce0f58b3cb9f8df19c8dd265
Author: nic-chen <ch...@gmail.com>
AuthorDate: Mon Apr 18 12:13:10 2022 +0800

    fix backend unit test failed
---
 api/internal/core/store/validate_test.go | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/api/internal/core/store/validate_test.go b/api/internal/core/store/validate_test.go
index c85e39a5..1ff7a984 100644
--- a/api/internal/core/store/validate_test.go
+++ b/api/internal/core/store/validate_test.go
@@ -78,12 +78,13 @@ func TestAPISIXJsonSchemaValidator_Validate(t *testing.T) {
 	reqBody := `{
 		"username": "jack",
 		"plugins": {
-		  "limit-count": {
-		      "count": 2,
-		      "time_window": 60,
-		      "rejected_code": 503,
-		      "key": "remote_addr"
-		  }
+			"limit-count": {
+				"count": 2,
+				"time_window": 60,
+				"rejected_code": 503,
+				"key": "remote_addr",
+				"policy": "local"
+			}
 		},
 		"desc": "test description"
 	}`
@@ -92,12 +93,12 @@ func TestAPISIXJsonSchemaValidator_Validate(t *testing.T) {
 	err = validator.Validate(consumer)
 	assert.Nil(t, err)
 
-	//check nil obj
+	// check nil obj
 	err = validator.Validate(nil)
 	assert.NotNil(t, err)
 	assert.EqualError(t, err, "schema validate failed: (root): Invalid type. Expected: object, given: null")
 
-	//plugin schema fail
+	// plugin schema fail
 	consumer3 := &entity.Consumer{}
 	reqBody = `{
 		"username": "jack",
@@ -105,7 +106,8 @@ func TestAPISIXJsonSchemaValidator_Validate(t *testing.T) {
 			"limit-count": {
 				"time_window": 60,
 				"rejected_code": 503,
-				"key": "remote_addr"
+				"key": "remote_addr",
+				"policy": "local"
 			}
 		},
 		"desc": "test description"