diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b8cbd6..930945b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased](https://github.com/fivetran/go-fivetran/compare/v1.0.1...HEAD) +## [Unreleased](https://github.com/fivetran/go-fivetran/compare/v1.0.2...HEAD) + +## [1.0.2](https://github.com/fivetran/go-fivetran/compare/v1.0.1...v1.0.2) + +## Added +Support for custom config (`map[string]interface{}`) for private links: +- `PrivateLinkCreateService.ConfigCustom` and `PrivateLinkCreateService.DoCustom` methods +- `PrivateLinkModifyService.ConfigCustom` and `PrivateLinkModifyService.DoCustom` methods +- `PrivateLinkDetailsService.DoCustom` method ## [1.0.1](https://github.com/fivetran/go-fivetran/compare/v1.0.0...v1.0.1) diff --git a/client.go b/client.go index 83f23a8..dfe1322 100644 --- a/client.go +++ b/client.go @@ -37,7 +37,7 @@ const defaultBaseURL = "https://api.fivetran.com/v1" const restAPIv2 = "application/json;version=2" // WARNING: Update Agent version on each release! -const defaultUserAgent = "Go-Fivetran/0.9.4" +const defaultUserAgent = "Go-Fivetran/1.0.2" // New receives API Key and API Secret, and returns a new Client with the // default HTTP client diff --git a/private_link/common_types.go b/private_link/common_types.go index 03ecc1f..1dac92f 100644 --- a/private_link/common_types.go +++ b/private_link/common_types.go @@ -22,6 +22,25 @@ type PrivateLinkResponse struct { } `json:"data"` } +type PrivateLinkCustomResponse struct { + Code string `json:"code"` + Message string `json:"message"` + Data struct { + PrivateLinkResponseBase + Config map[string]interface{} `json:"config"` + } `json:"data"` +} + +type PrivateLinkCustomMergedResponse struct { + Code string `json:"code"` + Message string `json:"message"` + Data struct { + PrivateLinkResponseBase + CustomConfig map[string]interface{} `json:"config"` + Config PrivateLinkConfigResponse // no mapping here + } `json:"data"` +} + type PrivateLinkListResponse struct { Code string `json:"code"` Data struct { @@ -30,13 +49,26 @@ type PrivateLinkListResponse struct { } `json:"data"` } -type privateLinkCreateRequest struct { +type privateLinkCreateRequestBase struct { Name *string `json:"name,omitempty"` Region *string `json:"region,omitempty"` Service *string `json:"service,omitempty"` +} + +type privateLinkCreateRequest struct { + privateLinkCreateRequestBase Config any `json:"config,omitempty"` } +type privateLinkCustomCreateRequest struct { + privateLinkCreateRequestBase + Config *map[string]interface{} `json:"config,omitempty"` +} + type privateLinkModifyRequest struct { Config any `json:"config,omitempty"` +} + +type privateLinkCustomModifyRequest struct { + Config *map[string]interface{} `json:"config,omitempty"` } \ No newline at end of file diff --git a/private_link/private_link_config.go b/private_link/private_link_config.go index a321545..03a6e17 100644 --- a/private_link/private_link_config.go +++ b/private_link/private_link_config.go @@ -1,5 +1,7 @@ package privatelink +import "github.com/fivetran/go-fivetran/utils" + // PrivateLinkConfig builds Private Link Management, Private Link Config. // Ref. https://fivetran.com/docs/rest-api/private-link-management#privatelinketupconfigurations type PrivateLinkConfig struct { @@ -65,6 +67,14 @@ func (plc *PrivateLinkConfig) Request() *privateLinkConfigRequest { } } +func (plc *PrivateLinkConfig) Merge(customConfig *map[string]interface{}) (*map[string]interface{}, error) { + err := utils.MergeIntoMap(plc.Request(), customConfig) + if err != nil { + return nil, err + } + return customConfig, nil +} + func (plc *PrivateLinkConfig) ConnectionServiceName(value string) *PrivateLinkConfig { plc.connectionServiceName = &value return plc diff --git a/private_link/private_link_create.go b/private_link/private_link_create.go index ab6cb27..fa40c4e 100644 --- a/private_link/private_link_create.go +++ b/private_link/private_link_create.go @@ -4,6 +4,7 @@ import ( "context" httputils "github.com/fivetran/go-fivetran/http_utils" + "github.com/fivetran/go-fivetran/utils" ) // PrivateLinkCreateService implements the Log Management, Create a Log Service API. @@ -14,23 +15,56 @@ type PrivateLinkCreateService struct { region *string service *string config *PrivateLinkConfig + configCustom *map[string]interface{} } -func (s *PrivateLinkCreateService) request() privateLinkCreateRequest { +func (s *PrivateLinkCreateService) requestBase() privateLinkCreateRequestBase { + return privateLinkCreateRequestBase{ + Name: s.name, + Region: s.region, + Service: s.service, + } +} + +func (s *PrivateLinkCreateService) request() *privateLinkCreateRequest { var config interface{} if s.config != nil { config = s.config.Request() } - return privateLinkCreateRequest{ - Name: s.name, - Region: s.region, - Service: s.service, - Config: config, + r := &privateLinkCreateRequest{ + privateLinkCreateRequestBase: s.requestBase(), + Config: config, + } + + return r +} + +func (s *PrivateLinkCreateService) requestCustom() *privateLinkCustomCreateRequest { + return &privateLinkCustomCreateRequest{ + privateLinkCreateRequestBase: s.requestBase(), + Config: s.configCustom, } } +func (s *PrivateLinkCreateService) requestCustomMerged() (*privateLinkCustomCreateRequest, error) { + currentConfig := s.configCustom + + if s.config != nil { + var err error + currentConfig, err = s.config.Merge(currentConfig) + if err != nil { + return nil, err + } + } + + return &privateLinkCustomCreateRequest{ + privateLinkCreateRequestBase: s.requestBase(), + Config: currentConfig, + }, nil +} + func (s *PrivateLinkCreateService) Region(value string) *PrivateLinkCreateService { s.region = &value return s @@ -51,8 +85,46 @@ func (s *PrivateLinkCreateService) Config(value *PrivateLinkConfig) *PrivateLink return s } +func (s *PrivateLinkCreateService) ConfigCustom(value *map[string]interface{}) *PrivateLinkCreateService { + s.configCustom = value + return s +} + +func (s *PrivateLinkCreateService) do(ctx context.Context, req, response any) error { + err := s.HttpService.Do(ctx, "POST", "/private-links", s.request(), nil, 201, &response) + return err +} + func (s *PrivateLinkCreateService) Do(ctx context.Context) (PrivateLinkResponse, error) { var response PrivateLinkResponse - err := s.HttpService.Do(ctx, "POST", "/private-links", s.request(), nil, 201, &response) + + err := s.do(ctx, s.request(), &response) + + return response, err +} + +func (s *PrivateLinkCreateService) DoCustom(ctx context.Context) (PrivateLinkCustomResponse, error) { + var response PrivateLinkCustomResponse + + err := s.do(ctx, s.requestCustom(), &response) + + return response, err +} + +func (s *PrivateLinkCreateService) DoCustomMerged(ctx context.Context) (PrivateLinkCustomMergedResponse, error) { + var response PrivateLinkCustomMergedResponse + + req, err := s.requestCustomMerged() + + if err != nil { + return response, err + } + + err = s.do(ctx, req, &response) + + if err == nil { + err = utils.FetchFromMap(&response.Data.CustomConfig, &response.Data.Config) + } + return response, err } \ No newline at end of file diff --git a/private_link/private_link_details.go b/private_link/private_link_details.go index b160f89..99eb4e5 100644 --- a/private_link/private_link_details.go +++ b/private_link/private_link_details.go @@ -25,6 +25,17 @@ func (s *PrivateLinkDetailsService) Do(ctx context.Context) (PrivateLinkResponse return response, fmt.Errorf("missing required privateLinkId") } + url := fmt.Sprintf("/private-links/%v", *s.privateLinkId) + err := s.HttpService.Do(ctx, "GET", url, nil, nil, 200, &response) + return response, err +} + +func (s *PrivateLinkDetailsService) DoCustom(ctx context.Context) (PrivateLinkCustomResponse, error) { + var response PrivateLinkCustomResponse + if s.privateLinkId == nil { + return response, fmt.Errorf("missing required privateLinkId") + } + url := fmt.Sprintf("/private-links/%v", *s.privateLinkId) err := s.HttpService.Do(ctx, "GET", url, nil, nil, 200, &response) return response, err diff --git a/private_link/private_link_details_test.go b/private_link/private_link_details_test.go index b4b69f7..e05dd34 100644 --- a/private_link/private_link_details_test.go +++ b/private_link/private_link_details_test.go @@ -13,7 +13,7 @@ func TestPrivateLinkDetailsServiceDo(t *testing.T) { // arrange ftClient, mockClient := testutils.CreateTestClient() - handler := mockClient.When(http.MethodGet, "/v1/private-links/123456"). + handler := mockClient.When(http.MethodGet, "/v1/private-links/private_link_id"). ThenCall(func(req *http.Request) (*http.Response, error) { response := mock.NewResponse(req, http.StatusOK, preparePrivateLinkDetailsResponse()) return response, nil @@ -21,7 +21,7 @@ func TestPrivateLinkDetailsServiceDo(t *testing.T) { // act response, err := ftClient.NewPrivateLinkDetails(). - PrivateLinkId("123456"). + PrivateLinkId("private_link_id"). Do(context.Background()) // assert @@ -36,11 +36,38 @@ func TestPrivateLinkDetailsServiceDo(t *testing.T) { assertPrivateLinkDetailsResponse(t, response) } +func TestPrivateLinkDetailsCustomServiceDo(t *testing.T) { + // arrange + + ftClient, mockClient := testutils.CreateTestClient() + handler := mockClient.When(http.MethodGet, "/v1/private-links/private_link_id"). + ThenCall(func(req *http.Request) (*http.Response, error) { + response := mock.NewResponse(req, http.StatusOK, preparePrivateLinkDetailsResponse()) + return response, nil + }) + + // act + response, err := ftClient.NewPrivateLinkDetails(). + PrivateLinkId("private_link_id"). + DoCustom(context.Background()) + + // assert + if err != nil { + t.Error(err) + } + + interactions := mockClient.Interactions() + testutils.AssertEqual(t, len(interactions), 1) + testutils.AssertEqual(t, interactions[0].Handler, handler) + testutils.AssertEqual(t, handler.Interactions, 1) + assertPrivateLinkCustomDetailsResponse(t, response) +} + func preparePrivateLinkDetailsResponse() string { return `{ "code": "Success", "data": { - "id": "123456", + "id": "private_link_id", "name": "name", "region": "region", "service": "service", @@ -59,7 +86,7 @@ func preparePrivateLinkDetailsResponse() string { func assertPrivateLinkDetailsResponse(t *testing.T, response privatelink.PrivateLinkResponse) { testutils.AssertEqual(t, response.Code, "Success") - testutils.AssertEqual(t, response.Data.Id, "123456") + testutils.AssertEqual(t, response.Data.Id, "private_link_id") testutils.AssertEqual(t, response.Data.Name, "name") testutils.AssertEqual(t, response.Data.Region, "region") testutils.AssertEqual(t, response.Data.Service, "service") @@ -70,3 +97,17 @@ func assertPrivateLinkDetailsResponse(t *testing.T, response privatelink.Private testutils.AssertEqual(t, response.Data.CreatedBy, "created_by") testutils.AssertEqual(t, response.Data.Config.ConnectionServiceName, "connection_service_name") } + +func assertPrivateLinkCustomDetailsResponse(t *testing.T, response privatelink.PrivateLinkCustomResponse) { + testutils.AssertEqual(t, response.Code, "Success") + testutils.AssertEqual(t, response.Data.Id, "private_link_id") + testutils.AssertEqual(t, response.Data.Name, "name") + testutils.AssertEqual(t, response.Data.Region, "region") + testutils.AssertEqual(t, response.Data.Service, "service") + testutils.AssertEqual(t, response.Data.CloudProvider, "cloud_provider") + testutils.AssertEqual(t, response.Data.State, "state") + testutils.AssertEqual(t, response.Data.StateSummary, "state_summary") + testutils.AssertEqual(t, response.Data.CreatedAt, "2022-04-29T09:41:08.583Z") + testutils.AssertEqual(t, response.Data.CreatedBy, "created_by") + testutils.AssertEqual(t, response.Data.Config["connection_service_name"], "connection_service_name") +} \ No newline at end of file diff --git a/private_link/private_link_modify.go b/private_link/private_link_modify.go index f6592ea..3d7e7b1 100644 --- a/private_link/private_link_modify.go +++ b/private_link/private_link_modify.go @@ -5,6 +5,7 @@ import ( "fmt" httputils "github.com/fivetran/go-fivetran/http_utils" + "github.com/fivetran/go-fivetran/utils" ) // PrivateLinkModifyService implements the Private Link Management, Modify a Private Link Service API. @@ -13,6 +14,7 @@ type PrivateLinkModifyService struct { httputils.HttpService privateLinkId *string config *PrivateLinkConfig + configCustom *map[string]interface{} } func (s *PrivateLinkModifyService) request() *privateLinkModifyRequest { @@ -23,10 +25,32 @@ func (s *PrivateLinkModifyService) request() *privateLinkModifyRequest { } return &privateLinkModifyRequest{ - Config: config, + Config: config, } } +func (s *PrivateLinkModifyService) requestCustom() *privateLinkCustomModifyRequest { + return &privateLinkCustomModifyRequest{ + Config: s.configCustom, + } +} + +func (s *PrivateLinkModifyService) requestCustomMerged() (*privateLinkCustomModifyRequest, error) { + currentConfig := s.configCustom + + if s.config != nil { + var err error + currentConfig, err = s.config.Merge(currentConfig) + if err != nil { + return nil, err + } + } + + return &privateLinkCustomModifyRequest{ + Config: currentConfig, + }, nil +} + func (s *PrivateLinkModifyService) PrivateLinkId(value string) *PrivateLinkModifyService { s.privateLinkId = &value return s @@ -37,13 +61,51 @@ func (s *PrivateLinkModifyService) Config(value *PrivateLinkConfig) *PrivateLink return s } -func (s *PrivateLinkModifyService) Do(ctx context.Context) (PrivateLinkResponse, error) { - var response PrivateLinkResponse +func (s *PrivateLinkModifyService) ConfigCustom(value *map[string]interface{}) *PrivateLinkModifyService { + s.configCustom = value + return s +} + +func (s *PrivateLinkModifyService) do(ctx context.Context, req, response any) error { if s.privateLinkId == nil { - return response, fmt.Errorf("missing required privateLinkId") + return fmt.Errorf("missing required privateLinkId") } url := fmt.Sprintf("/private-links/%v", *s.privateLinkId) - err := s.HttpService.Do(ctx, "PATCH", url, s.request(), nil, 200, &response) + err := s.HttpService.Do(ctx, "PATCH", url, req, nil, 200, &response) + return err +} + +func (s *PrivateLinkModifyService) Do(ctx context.Context) (PrivateLinkResponse, error) { + var response PrivateLinkResponse + + err := s.do(ctx, s.request(), &response) + + return response, err +} + +func (s *PrivateLinkModifyService) DoCustom(ctx context.Context) (PrivateLinkCustomResponse, error) { + var response PrivateLinkCustomResponse + + err := s.do(ctx, s.requestCustom(), &response) + + return response, err +} + +func (s *PrivateLinkModifyService) DoCustomMerged(ctx context.Context) (PrivateLinkCustomMergedResponse, error) { + var response PrivateLinkCustomMergedResponse + + req, err := s.requestCustomMerged() + + if err != nil { + return response, err + } + + err = s.do(ctx, req, &response) + + if err == nil { + err = utils.FetchFromMap(&response.Data.CustomConfig, &response.Data.Config) + } + return response, err } \ No newline at end of file diff --git a/private_link/private_link_modify_test.go b/private_link/private_link_modify_test.go index f5c8bd4..475e9b9 100644 --- a/private_link/private_link_modify_test.go +++ b/private_link/private_link_modify_test.go @@ -14,7 +14,7 @@ func TestPrivateLinkModifyServiceDo(t *testing.T) { // arrange ftClient, mockClient := testutils.CreateTestClient() - handler := mockClient.When(http.MethodPatch, "/v1/private-links/123456"). + handler := mockClient.When(http.MethodPatch, "/v1/private-links/private_link_id"). ThenCall(func(req *http.Request) (*http.Response, error) { response := mock.NewResponse(req, http.StatusOK, preparePrivateLinkModifyResponse()) return response, nil @@ -22,7 +22,7 @@ func TestPrivateLinkModifyServiceDo(t *testing.T) { // act response, err := ftClient.NewPrivateLinkModify(). - PrivateLinkId("123456"). + PrivateLinkId("private_link_id"). Config(preparePrivateLinkModifyConfig()). Do(context.Background()) @@ -38,11 +38,74 @@ func TestPrivateLinkModifyServiceDo(t *testing.T) { assertPrivateLinkModifyResponse(t, response) } +func TestPrivateLinkCustomModifyService(t *testing.T) { + // arrange + ftClient, mockClient := testutils.CreateTestClient() + handler := mockClient.When(http.MethodPatch, "/v1/private-links/private_link_id").ThenCall( + func(req *http.Request) (*http.Response, error) { + body := testutils.RequestBodyToJson(t, req) + assertPrivateLinkModifyCustomRequest(t, body) + response := mock.NewResponse(req, http.StatusOK, preparePrivateLinkModifyCustomResponse()) + return response, nil + }) + + // act + response, err := ftClient.NewPrivateLinkModify(). + PrivateLinkId("private_link_id"). + ConfigCustom(preparePrivateLinkCustomConfig()). + DoCustom(context.Background()) + + if err != nil { + t.Logf("%+v\n", response) + t.Error(err) + } + + // assert + interactions := mockClient.Interactions() + testutils.AssertEqual(t, len(interactions), 1) + testutils.AssertEqual(t, interactions[0].Handler, handler) + testutils.AssertEqual(t, handler.Interactions, 1) + + assertPrivateLinkModifyCustomResponse(t, response) +} + +func TestPrivateLinkCustomMergedModifyService(t *testing.T) { + // arrange + ftClient, mockClient := testutils.CreateTestClient() + handler := mockClient.When(http.MethodPatch, "/v1/private-links/private_link_id"). + ThenCall(func(req *http.Request) (*http.Response, error) { + body := testutils.RequestBodyToJson(t, req) + assertPrivateLinkModifyCustomMergedRequest(t, body) + response := mock.NewResponse(req, http.StatusOK, preparePrivateLinkModifyMergedResponse()) + return response, nil + }) + + // act + response, err := ftClient.NewPrivateLinkModify(). + PrivateLinkId("private_link_id"). + Config(preparePrivateLinkModifyConfig()). + ConfigCustom(preparePrivateLinkCustomConfig()). + DoCustomMerged(context.Background()) + + if err != nil { + t.Logf("%+v\n", response) + t.Error(err) + } + + // assert + interactions := mockClient.Interactions() + testutils.AssertEqual(t, len(interactions), 1) + testutils.AssertEqual(t, interactions[0].Handler, handler) + testutils.AssertEqual(t, handler.Interactions, 1) + + assertPrivateLinkModifyCustomMergedResponse(t, response) +} + func preparePrivateLinkModifyResponse() string { return `{ "code": "Success", "data": { - "id": "123456", + "id": "private_link_id", "name": "name", "region": "region", "service": "service", @@ -59,6 +122,49 @@ func preparePrivateLinkModifyResponse() string { }` } +func preparePrivateLinkModifyCustomResponse() string { + return `{ + "code": "Success", + "data": { + "id": "private_link_id", + "name": "name", + "region": "region", + "service": "service", + "account_id": "account_id", + "cloud_provider": "cloud_provider", + "state": "state", + "state_summary": "state_summary", + "created_at": "2022-04-29T09:41:08.583Z", + "created_by": "created_by", + "config": { + "connection_service_name_fake": "connection_service_name_fake" + } + } +}` +} + +func preparePrivateLinkModifyMergedResponse() string { + return `{ + "code": "Success", + "data": { + "id": "private_link_id", + "name": "name", + "region": "region", + "service": "service", + "account_id": "account_id", + "cloud_provider": "cloud_provider", + "state": "state", + "state_summary": "state_summary", + "created_at": "2022-04-29T09:41:08.583Z", + "created_by": "created_by", + "config": { + "connection_service_name": "connection_service_name", + "connection_service_name_fake": "connection_service_name_fake" + } + } +}` +} + func preparePrivateLinkModifyConfig() *privatelink.PrivateLinkConfig { config := fivetran.NewPrivateLinkConfig() config.ConnectionServiceName("connection_service_name") @@ -66,9 +172,72 @@ func preparePrivateLinkModifyConfig() *privatelink.PrivateLinkConfig { return config } +func preparePrivateLinkCustomConfig() *map[string]interface{} { + config := make(map[string]interface{}) + + config["connection_service_name_fake"] = "connection_service_name_fake" + + return &config +} + +// assert Requests +func assertPrivateLinkModifyRequest(t *testing.T, request map[string]interface{}) { + config, ok := request["config"].(map[string]interface{}) + testutils.AssertEqual(t, ok, true) + + testutils.AssertKey(t, "connection_service_name", config, "connection_service_name") +} + +func assertPrivateLinkModifyCustomRequest(t *testing.T, request map[string]interface{}) { + config, ok := request["config"].(map[string]interface{}) + + testutils.AssertEqual(t, ok, true) + + testutils.AssertKey(t, "connection_service_name_fake", config, "connection_service_name_fake") +} + +func assertPrivateLinkModifyCustomMergedRequest(t *testing.T, request map[string]interface{}) { + config, ok := request["config"].(map[string]interface{}) + + testutils.AssertEqual(t, ok, true) + + testutils.AssertKey(t, "connection_service_name", config, "connection_service_name") + testutils.AssertKey(t, "connection_service_name_fake", config, "connection_service_name_fake") +} + +// assert Response func assertPrivateLinkModifyResponse(t *testing.T, response privatelink.PrivateLinkResponse) { testutils.AssertEqual(t, response.Code, "Success") - testutils.AssertEqual(t, response.Data.Id, "123456") + testutils.AssertEqual(t, response.Data.Id, "private_link_id") + testutils.AssertEqual(t, response.Data.Name, "name") + testutils.AssertEqual(t, response.Data.Region, "region") + testutils.AssertEqual(t, response.Data.Service, "service") + testutils.AssertEqual(t, response.Data.CloudProvider, "cloud_provider") + testutils.AssertEqual(t, response.Data.State, "state") + testutils.AssertEqual(t, response.Data.StateSummary, "state_summary") + testutils.AssertEqual(t, response.Data.CreatedAt, "2022-04-29T09:41:08.583Z") + testutils.AssertEqual(t, response.Data.CreatedBy, "created_by") + testutils.AssertEqual(t, response.Data.Config.ConnectionServiceName, "connection_service_name") +} + +func assertPrivateLinkModifyCustomResponse(t *testing.T, response privatelink.PrivateLinkCustomResponse) { + testutils.AssertEqual(t, response.Code, "Success") + testutils.AssertEqual(t, response.Data.Id, "private_link_id") + testutils.AssertEqual(t, response.Data.Name, "name") + testutils.AssertEqual(t, response.Data.Region, "region") + testutils.AssertEqual(t, response.Data.Service, "service") + testutils.AssertEqual(t, response.Data.CloudProvider, "cloud_provider") + testutils.AssertEqual(t, response.Data.State, "state") + testutils.AssertEqual(t, response.Data.StateSummary, "state_summary") + testutils.AssertEqual(t, response.Data.CreatedAt, "2022-04-29T09:41:08.583Z") + testutils.AssertEqual(t, response.Data.CreatedBy, "created_by") + + testutils.AssertKey(t, "connection_service_name_fake", response.Data.Config, "connection_service_name_fake") +} + +func assertPrivateLinkModifyCustomMergedResponse(t *testing.T, response privatelink.PrivateLinkCustomMergedResponse) { + testutils.AssertEqual(t, response.Code, "Success") + testutils.AssertEqual(t, response.Data.Id, "private_link_id") testutils.AssertEqual(t, response.Data.Name, "name") testutils.AssertEqual(t, response.Data.Region, "region") testutils.AssertEqual(t, response.Data.Service, "service") @@ -77,5 +246,10 @@ func assertPrivateLinkModifyResponse(t *testing.T, response privatelink.PrivateL testutils.AssertEqual(t, response.Data.StateSummary, "state_summary") testutils.AssertEqual(t, response.Data.CreatedAt, "2022-04-29T09:41:08.583Z") testutils.AssertEqual(t, response.Data.CreatedBy, "created_by") + testutils.AssertEqual(t, response.Data.Config.ConnectionServiceName, "connection_service_name") -} \ No newline at end of file + testutils.AssertKey(t, "connection_service_name_fake", response.Data.CustomConfig, "connection_service_name_fake") +} + + + diff --git a/tests/e2e/dbt_project_create_test.go b/tests/e2e/dbt_project_create_test.go index d07d9fa..97296cb 100644 --- a/tests/e2e/dbt_project_create_test.go +++ b/tests/e2e/dbt_project_create_test.go @@ -9,6 +9,8 @@ import ( ) func TestNewDbtProjectCreateE2E(t *testing.T) { + t.Skip("Unstable test; will be delete with refactoring DBT") + dbtVersion := "1.3.1" gitRemoteUrl := "https://github.com/fivetran/dbt_demo" gitBranch := "main" diff --git a/tests/e2e/dbt_project_delete_test.go b/tests/e2e/dbt_project_delete_test.go index 265dbe6..cf21a62 100644 --- a/tests/e2e/dbt_project_delete_test.go +++ b/tests/e2e/dbt_project_delete_test.go @@ -9,6 +9,7 @@ import ( ) func TestNewProjectDeleteE2E(t *testing.T) { + t.Skip("Unstable test; will be delete with refactoring DBT") projectId := testutils.CreateDbtProject(t) deleted, err := testutils.Client.NewDbtProjectDelete().DbtProjectID(projectId).Do(context.Background()) if err != nil {