Skip to content

Commit a64b094

Browse files
committed
Parrot container test
1 parent c6e2eb5 commit a64b094

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

.golangci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ linters-settings:
2424
exhaustive:
2525
default-signifies-exhaustive: true
2626
goimports:
27-
local-prefixes: github.com/smartcontractkit/chainlink-testing-framework/lib
27+
local-prefixes: github.com/smartcontractkit/chainlink-testing-framework/
2828
gosec:
2929
exclude-generated: true
3030
govet:

lib/docker/test_env/parrot.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"github.com/smartcontractkit/chainlink-testing-framework/parrot"
1919
)
2020

21-
const defaultParrotImage = "kalverra/parrot:v0.4.5"
21+
const defaultParrotImage = "kalverra/parrot:v0.5.0"
2222

2323
// Parrot is a test environment component that wraps a Parrot server.
2424
type Parrot struct {

lib/docker/test_env/parrot_test.go

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
package test_env
22

33
import (
4+
"net/http"
45
"testing"
56

7+
"github.com/stretchr/testify/require"
8+
69
"github.com/smartcontractkit/chainlink-testing-framework/lib/docker"
710
"github.com/smartcontractkit/chainlink-testing-framework/lib/logging"
8-
"github.com/stretchr/testify/require"
11+
"github.com/smartcontractkit/chainlink-testing-framework/parrot"
912
)
1013

1114
func TestParrot(t *testing.T) {
@@ -18,4 +21,18 @@ func TestParrot(t *testing.T) {
1821
p := NewParrot([]string{network.Name}).WithTestInstance(t)
1922
err = p.StartContainer()
2023
require.NoError(t, err)
24+
25+
route := &parrot.Route{
26+
Method: http.MethodGet,
27+
Path: "/test",
28+
RawResponseBody: "Squawk",
29+
ResponseStatusCode: http.StatusOK,
30+
}
31+
err = p.Client.RegisterRoute(route)
32+
require.NoError(t, err, "failed to register route")
33+
34+
resp, err := p.Client.CallRoute(route.Method, route.Path)
35+
require.NoError(t, err, "failed to call route")
36+
require.Equal(t, http.StatusOK, resp.StatusCode())
37+
require.Equal(t, "Squawk", string(resp.Body()))
2138
}

0 commit comments

Comments
 (0)