Skip to content

Commit

Permalink
test: update test cases with correct protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
JadhavPoonam committed Aug 23, 2024
1 parent 26079f0 commit 6d73e47
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions agent/config_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ func TestConfig_Apply_CAS(t *testing.T) {
{
"Kind": "service-defaults",
"Name": "foo",
"Protocol": "udp"
"Protocol": "http"
}
`))
req, _ = http.NewRequest("PUT", "/v1/config?cas=0", body)
Expand All @@ -628,7 +628,7 @@ func TestConfig_Apply_CAS(t *testing.T) {
{
"Kind": "service-defaults",
"Name": "foo",
"Protocol": "udp"
"Protocol": "http"
}
`))
req, _ = http.NewRequest("PUT", fmt.Sprintf("/v1/config?cas=%d", entry.GetRaftIndex().ModifyIndex), body)
Expand Down
6 changes: 3 additions & 3 deletions agent/consul/config_replication_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ package consul
import (
"context"
"fmt"
"github.com/oklog/ulid/v2"
"github.com/stretchr/testify/assert"
"os"
"testing"

"github.com/oklog/ulid/v2"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/hashicorp/consul/agent/structs"
Expand Down Expand Up @@ -129,7 +129,7 @@ func TestReplication_ConfigEntries(t *testing.T) {
Entry: &structs.ServiceConfigEntry{
Kind: structs.ServiceDefaults,
Name: fmt.Sprintf("svc-%d", i),
Protocol: "udp",
Protocol: "tcp",
},
}

Expand Down
6 changes: 3 additions & 3 deletions api/config_entry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func TestAPI_ConfigEntries(t *testing.T) {
service := &ServiceConfigEntry{
Kind: ServiceDefaults,
Name: "foo",
Protocol: "udp",
Protocol: "http",
MutualTLSMode: MutualTLSModeStrict,
Meta: map[string]string{
"foo": "bar",
Expand All @@ -124,7 +124,7 @@ func TestAPI_ConfigEntries(t *testing.T) {
service2 := &ServiceConfigEntry{
Kind: ServiceDefaults,
Name: "bar",
Protocol: "tcp",
Protocol: "http",
Destination: dest,
}

Expand Down Expand Up @@ -176,7 +176,7 @@ func TestAPI_ConfigEntries(t *testing.T) {
require.True(t, written)

// update no cas
service.Protocol = "http"
service.Protocol = "tcp"

_, wm, err = config_entries.Set(service, nil)
require.NoError(t, err)
Expand Down
4 changes: 2 additions & 2 deletions command/config/write/config_write_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestConfigWrite(t *testing.T) {
_, err := f.WriteString(`
Kind = "service-defaults"
Name = "web"
Protocol = "udp"
Protocol = "tcp"
`)

require.NoError(t, err)
Expand All @@ -65,7 +65,7 @@ func TestConfigWrite(t *testing.T) {
require.True(t, ok)
require.Equal(t, api.ServiceDefaults, svc.Kind)
require.Equal(t, "web", svc.Name)
require.Equal(t, "udp", svc.Protocol)
require.Equal(t, "tcp", svc.Protocol)
})

t.Run("Stdin", func(t *testing.T) {
Expand Down

0 comments on commit 6d73e47

Please sign in to comment.