Skip to content

Commit

Permalink
Adapt integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgebay committed Nov 17, 2022
1 parent ca07816 commit fd5a319
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ check out the [Contributing Guide](./CONTRIBUTING.md).
## Getting Started

Producing and consuming messages from Barco is as simple as sending a HTTP request. Use your favorite HTTP client in
your technology stack to send and retrieve events. Additionally, we also provide a [Go Client Library][go-client].
your technology stack to send and receive events. Additionally, we also provide a [Go Client Library][go-client].

### Getting Started on Kubernetes

Expand Down
7 changes: 4 additions & 3 deletions internal/test/integration/roundtrip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ var _ = Describe("A 3 node cluster", func() {
registerStatelessConsumer(client, "c1", group, topic, StartFromEarliest)

// Try register on the second one: it should be a noop
// Use legacy "consumer_id" querystring parameter
const registerUrl = "http://127.0.0.1:9252/v1/consumer/register?consumer_id=%s&group=%s&topic=%s&onNewGroup=%s"
req, _ := http.NewRequest(http.MethodPut, fmt.Sprintf(registerUrl, "c1", group, topic, StartFromEarliest), nil)
resp, err := client.Do(req)
Expand All @@ -418,7 +419,7 @@ var _ = Describe("A 3 node cluster", func() {
}

for i := 0; i < 2; i++ {
req, _ := http.NewRequest(http.MethodPost, "http://127.0.0.1:9252/v1/consumer/goodbye?consumer_id=c1", nil)
req, _ := http.NewRequest(http.MethodPost, "http://127.0.0.1:9252/v1/consumer/goodbye?consumerId=c1", nil)
resp, err := client.Do(req)
Expect(err).NotTo(HaveOccurred())
if i == 0 {
Expand Down Expand Up @@ -545,7 +546,7 @@ func pollTimes(client *http.Client, consumerId string, times int) []map[string]a
messages := []map[string]any{}
for i := 0; i < times; i++ {
for brokerIp := 1; brokerIp <= 3; brokerIp++ {
pollUrl := fmt.Sprintf("http://127.0.0.%d:9252/v1/consumer/poll?consumer_id=%s", brokerIp, consumerId)
pollUrl := fmt.Sprintf("http://127.0.0.%d:9252/v1/consumer/poll?consumerId=%s", brokerIp, consumerId)
req, _ := http.NewRequest(http.MethodPost, pollUrl, nil)
req.Header.Add("Accept", "application/json")
resp, err := client.Do(req)
Expand Down Expand Up @@ -594,7 +595,7 @@ func produceOrderedJson(client *TestClient, topic string, startIndex int, totalM
}

func registerStatelessConsumer(client *http.Client, consumerId, group, topic string, onNewGroup OffsetResetPolicy) {
const registerUrl = "http://127.0.0.1:9252/v1/consumer/register?consumer_id=%s&group=%s&topic=%s&onNewGroup=%s"
const registerUrl = "http://127.0.0.1:9252/v1/consumer/register?consumerId=%s&group=%s&topic=%s&onNewGroup=%s"
req, _ := http.NewRequest(http.MethodPut, fmt.Sprintf(registerUrl, consumerId, group, topic, onNewGroup), nil)
resp, err := client.Do(req)
Expect(err).NotTo(HaveOccurred())
Expand Down

0 comments on commit fd5a319

Please sign in to comment.