Skip to content

Commit

Permalink
fix: unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
bzp2010 committed Sep 2, 2021
1 parent b46d470 commit 3923974
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 85 deletions.
2 changes: 1 addition & 1 deletion api/internal/handler/schema/plugin_test.go
Expand Up @@ -62,5 +62,5 @@ func TestPlugin(t *testing.T) {
// plugin type
assert.ElementsMatch(t, []string{"basic-auth", "jwt-auth", "hmac-auth", "key-auth", "wolf-rbac"}, authPlugins)
// consumer schema
assert.Equal(t, `{"additionalProperties":false,"properties":{"password":{"type":"string"},"username":{"type":"string"}},"required":["password","username"],"title":"work with consumer object","type":"object"}`, basicAuthConsumerSchema)
assert.Equal(t, `{"properties":{"password":{"type":"string"},"username":{"type":"string"}},"required":["password","username"],"title":"work with consumer object","type":"object"}`, basicAuthConsumerSchema)
}
168 changes: 84 additions & 84 deletions api/internal/handler/upstream/upstream_test.go
Expand Up @@ -55,10 +55,10 @@ func TestUpstream_Get(t *testing.T) {
},
UpstreamDef: entity.UpstreamDef{
Name: "upstream1",
Timeout: map[string]interface{}{
"connect": 15,
"send": 15,
"read": 15,
Timeout: &entity.Timeout{
Connect: 15,
Send: 15,
Read: 15,
},
Checks: map[string]interface{}{
"active": map[string]interface{}{
Expand Down Expand Up @@ -103,10 +103,10 @@ func TestUpstream_Get(t *testing.T) {
},
UpstreamDef: entity.UpstreamDef{
Name: "upstream1",
Timeout: map[string]interface{}{
"connect": 15,
"send": 15,
"read": 15,
Timeout: &entity.Timeout{
Connect: 15,
Send: 15,
Read: 15,
},
Checks: map[string]interface{}{
"active": map[string]interface{}{
Expand Down Expand Up @@ -345,10 +345,10 @@ func TestUpstream_Create(t *testing.T) {
},
UpstreamDef: entity.UpstreamDef{
Name: "upstream1",
Timeout: map[string]interface{}{
"connect": 15,
"send": 15,
"read": 15,
Timeout: &entity.Timeout{
Connect: 15,
Send: 15,
Read: 15,
},
Checks: map[string]interface{}{
"active": map[string]interface{}{
Expand Down Expand Up @@ -393,10 +393,10 @@ func TestUpstream_Create(t *testing.T) {
},
UpstreamDef: entity.UpstreamDef{
Name: "upstream1",
Timeout: map[string]interface{}{
"connect": 15,
"send": 15,
"read": 15,
Timeout: &entity.Timeout{
Connect: 15,
Send: 15,
Read: 15,
},
Checks: map[string]interface{}{
"active": map[string]interface{}{
Expand Down Expand Up @@ -441,10 +441,10 @@ func TestUpstream_Create(t *testing.T) {
},
UpstreamDef: entity.UpstreamDef{
Name: "upstream1",
Timeout: map[string]interface{}{
"connect": 15,
"send": 15,
"read": 15,
Timeout: &entity.Timeout{
Connect: 15,
Send: 15,
Read: 15,
},
Checks: map[string]interface{}{
"active": map[string]interface{}{
Expand Down Expand Up @@ -489,10 +489,10 @@ func TestUpstream_Create(t *testing.T) {
},
UpstreamDef: entity.UpstreamDef{
Name: "upstream1",
Timeout: map[string]interface{}{
"connect": 15,
"send": 15,
"read": 15,
Timeout: &entity.Timeout{
Connect: 15,
Send: 15,
Read: 15,
},
Checks: map[string]interface{}{
"active": map[string]interface{}{
Expand Down Expand Up @@ -542,10 +542,10 @@ func TestUpstream_Create(t *testing.T) {
},
UpstreamDef: entity.UpstreamDef{
Name: "upstream1",
Timeout: map[string]interface{}{
"connect": 15,
"send": 15,
"read": 15,
Timeout: &entity.Timeout{
Connect: 15,
Send: 15,
Read: 15,
},
Checks: map[string]interface{}{
"active": map[string]interface{}{
Expand Down Expand Up @@ -591,10 +591,10 @@ func TestUpstream_Create(t *testing.T) {
},
UpstreamDef: entity.UpstreamDef{
Name: "upstream1",
Timeout: map[string]interface{}{
"connect": 15,
"send": 15,
"read": 15,
Timeout: &entity.Timeout{
Connect: 15,
Send: 15,
Read: 15,
},
Checks: map[string]interface{}{
"active": map[string]interface{}{
Expand Down Expand Up @@ -689,10 +689,10 @@ func TestUpstream_Update(t *testing.T) {
Upstream: entity.Upstream{
UpstreamDef: entity.UpstreamDef{
Name: "upstream1",
Timeout: map[string]interface{}{
"connect": 15,
"send": 15,
"read": 15,
Timeout: &entity.Timeout{
Connect: 15,
Send: 15,
Read: 15,
},
Checks: map[string]interface{}{
"active": map[string]interface{}{
Expand Down Expand Up @@ -738,10 +738,10 @@ func TestUpstream_Update(t *testing.T) {
},
UpstreamDef: entity.UpstreamDef{
Name: "upstream1",
Timeout: map[string]interface{}{
"connect": 15,
"send": 15,
"read": 15,
Timeout: &entity.Timeout{
Connect: 15,
Send: 15,
Read: 15,
},
Checks: map[string]interface{}{
"active": map[string]interface{}{
Expand Down Expand Up @@ -786,10 +786,10 @@ func TestUpstream_Update(t *testing.T) {
},
UpstreamDef: entity.UpstreamDef{
Name: "upstream1",
Timeout: map[string]interface{}{
"connect": 15,
"send": 15,
"read": 15,
Timeout: &entity.Timeout{
Connect: 15,
Send: 15,
Read: 15,
},
Checks: map[string]interface{}{
"active": map[string]interface{}{
Expand Down Expand Up @@ -834,10 +834,10 @@ func TestUpstream_Update(t *testing.T) {
},
UpstreamDef: entity.UpstreamDef{
Name: "upstream1",
Timeout: map[string]interface{}{
"connect": 15,
"send": 15,
"read": 15,
Timeout: &entity.Timeout{
Connect: 15,
Send: 15,
Read: 15,
},
Checks: map[string]interface{}{
"active": map[string]interface{}{
Expand Down Expand Up @@ -887,10 +887,10 @@ func TestUpstream_Update(t *testing.T) {
},
UpstreamDef: entity.UpstreamDef{
Name: "upstream1",
Timeout: map[string]interface{}{
"connect": 15,
"send": 15,
"read": 15,
Timeout: &entity.Timeout{
Connect: 15,
Send: 15,
Read: 15,
},
Checks: map[string]interface{}{
"active": map[string]interface{}{
Expand Down Expand Up @@ -973,10 +973,10 @@ func TestUpstream_Patch(t *testing.T) {
},
UpstreamDef: entity.UpstreamDef{
Name: "upstream1",
Timeout: map[string]interface{}{
"connect": 15,
"send": 15,
"read": 15,
Timeout: &entity.Timeout{
Connect: 15,
Send: 15,
Read: 15,
},
Checks: map[string]interface{}{
"active": map[string]interface{}{
Expand Down Expand Up @@ -1022,10 +1022,10 @@ func TestUpstream_Patch(t *testing.T) {
},
UpstreamDef: entity.UpstreamDef{
Name: "upstream2",
Timeout: map[string]interface{}{
"connect": float64(20),
"send": float64(20),
"read": float64(20),
Timeout: &entity.Timeout{
Connect: 20,
Send: 20,
Read: 20,
},
Checks: map[string]interface{}{
"active": map[string]interface{}{
Expand Down Expand Up @@ -1085,10 +1085,10 @@ func TestUpstream_Patch(t *testing.T) {
},
UpstreamDef: entity.UpstreamDef{
Name: "upstream2",
Timeout: map[string]interface{}{
"connect": float64(20),
"send": float64(20),
"read": float64(20),
Timeout: &entity.Timeout{
Connect: 20,
Send: 20,
Read: 20,
},
Checks: map[string]interface{}{
"active": map[string]interface{}{
Expand Down Expand Up @@ -1138,10 +1138,10 @@ func TestUpstream_Patch(t *testing.T) {
},
UpstreamDef: entity.UpstreamDef{
Name: "upstream2",
Timeout: map[string]interface{}{
"connect": float64(20),
"send": float64(20),
"read": float64(20),
Timeout: &entity.Timeout{
Connect: 20,
Send: 20,
Read: 20,
},
Checks: map[string]interface{}{
"active": map[string]interface{}{
Expand Down Expand Up @@ -1186,10 +1186,10 @@ func TestUpstream_Patch(t *testing.T) {
},
UpstreamDef: entity.UpstreamDef{
Name: "upstream2",
Timeout: map[string]interface{}{
"connect": float64(20),
"send": float64(20),
"read": float64(20),
Timeout: &entity.Timeout{
Connect: 20,
Send: 20,
Read: 20,
},
Checks: map[string]interface{}{
"active": map[string]interface{}{
Expand Down Expand Up @@ -1243,10 +1243,10 @@ func TestUpstream_Patch(t *testing.T) {
},
UpstreamDef: entity.UpstreamDef{
Name: "upstream1",
Timeout: map[string]interface{}{
"connect": float64(20),
"send": float64(20),
"read": float64(20),
Timeout: &entity.Timeout{
Connect: 20,
Send: 20,
Read: 20,
},
Checks: map[string]interface{}{
"active": map[string]interface{}{
Expand Down Expand Up @@ -1291,10 +1291,10 @@ func TestUpstream_Patch(t *testing.T) {
},
UpstreamDef: entity.UpstreamDef{
Name: "upstream1",
Timeout: map[string]interface{}{
"connect": float64(15),
"send": float64(15),
"read": float64(15),
Timeout: &entity.Timeout{
Connect: 15,
Send: 15,
Read: 15,
},
Checks: map[string]interface{}{
"active": map[string]interface{}{
Expand Down Expand Up @@ -1339,10 +1339,10 @@ func TestUpstream_Patch(t *testing.T) {
},
UpstreamDef: entity.UpstreamDef{
Name: "upstream1",
Timeout: map[string]interface{}{
"connect": float64(20),
"send": float64(20),
"read": float64(20),
Timeout: &entity.Timeout{
Connect: 20,
Send: 20,
Read: 20,
},
Checks: map[string]interface{}{
"active": map[string]interface{}{
Expand Down

0 comments on commit 3923974

Please sign in to comment.