From caef0b34459241ffa21e9761ba59d550ee5440d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Zdyba=C5=82?= Date: Fri, 30 Jun 2023 21:05:53 +0200 Subject: [PATCH] cleanup --- client_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/client_test.go b/client_test.go index 86b80a1..073b91e 100644 --- a/client_test.go +++ b/client_test.go @@ -48,7 +48,7 @@ func (t *TestSuite) SetupSuite() { // exponential backoff-retry, because the application in the container might not be ready to accept connections yet pool.MaxWait = 60 * time.Second if err := pool.Retry(func() error { - resp, err := http.Get("http://localhost:" + resource.GetPort("26659/tcp") + "/balance") + resp, err := http.Get(fmt.Sprintf("http://localhost:%s/balance", resource.GetPort("26659/tcp"))) if err != nil { return err } @@ -75,7 +75,6 @@ func (t *TestSuite) SetupSuite() { } t.token = buf.String() - fmt.Println("token: ", t.token) } func (t *TestSuite) TearDownSuite() { @@ -89,8 +88,7 @@ func TestIntegrationTestSuite(t *testing.T) { } func (t *TestSuite) TestClient() { - fmt.Println("port:", t.resource.GetPort("26658/tcp")) - client, err := NewClient(context.Background(), "http://localhost:"+t.resource.GetPort("26658/tcp"), t.token) + client, err := NewClient(context.Background(), t.getRPCAddress(), t.token) t.NoError(err) defer client.Close() @@ -106,3 +104,7 @@ func (t *TestSuite) TestClient() { t.NoError(err) t.NotEmpty(info.APIVersion) } + +func (t *TestSuite) getRPCAddress() string { + return fmt.Sprintf("http://localhost:%s", t.resource.GetPort("26658/tcp")) +}