From 8da6c57b863ff84b9ae353d22857ca2142fb3613 Mon Sep 17 00:00:00 2001 From: Shreyas Goenka Date: Wed, 29 Jan 2025 16:07:49 +0100 Subject: [PATCH] address comments --- acceptance/config_test.go | 15 +++++++++++++-- libs/testserver/server.go | 12 ------------ 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/acceptance/config_test.go b/acceptance/config_test.go index 0cf9280c1..f340f0367 100644 --- a/acceptance/config_test.go +++ b/acceptance/config_test.go @@ -8,7 +8,6 @@ import ( "github.com/BurntSushi/toml" "github.com/databricks/cli/libs/testdiff" - "github.com/databricks/cli/libs/testserver" "github.com/stretchr/testify/require" ) @@ -40,7 +39,19 @@ type TestConfig struct { // "job_id": 1111 // } // ''' - Server []testserver.Stub + Server []ServerStub +} + +type ServerStub struct { + // The HTTP method and path to match. Examples: + // 1. /api/2.0/clusters/list (matches all methods) + // 2. GET /api/2.0/clusters/list + Pattern string + + // The response body to return. + Response struct { + Body string + } } // FindConfig finds the closest config file. diff --git a/libs/testserver/server.go b/libs/testserver/server.go index 711d20561..10269af8f 100644 --- a/libs/testserver/server.go +++ b/libs/testserver/server.go @@ -15,18 +15,6 @@ type Server struct { t testutil.TestingT } -type Stub struct { - // The HTTP method and path to match. Examples: - // 1. /api/2.0/clusters/list (matches all methods) - // 2. GET /api/2.0/clusters/list - Pattern string - - // The response body to return. - Response struct { - Body string - } -} - func New(t testutil.TestingT) *Server { mux := http.NewServeMux() server := httptest.NewServer(mux)