diff --git a/cmd/monaco/download/download_configs.go b/cmd/monaco/download/download_configs.go index abbce75d8..15d4effd3 100644 --- a/cmd/monaco/download/download_configs.go +++ b/cmd/monaco/download/download_configs.go @@ -295,7 +295,7 @@ func downloadConfigs(clientSet *client.ClientSet, apisToDownload api.APIs, opts if shouldDownloadDocuments(opts) { if opts.auth.OAuth != nil { log.Info("Downloading documents") - documentCfgs, err := fn.documentDownload(clientSet.Document(), opts.projectName) + documentCfgs, err := fn.documentDownload(clientSet.DocumentClient, opts.projectName) if err != nil { return nil, err } diff --git a/cmd/monaco/integrationtest/assert.go b/cmd/monaco/integrationtest/assert.go index 057464e84..378ddf215 100644 --- a/cmd/monaco/integrationtest/assert.go +++ b/cmd/monaco/integrationtest/assert.go @@ -169,7 +169,7 @@ func AssertAllConfigsAvailability(t *testing.T, fs afero.Fs, manifestPath string } foundID = AssertBucket(t, clients.Bucket(), env, available, theConfig) case config.DocumentType: - if clients.Document() == nil { + if clients.DocumentClient == nil { t.Errorf("can not assert existience of Document config %q) because no DocumentClient exists - was the test env not configured as Platform?", theConfig.Coordinate) return } diff --git a/cmd/monaco/integrationtest/v2/documents_integration_test.go b/cmd/monaco/integrationtest/v2/documents_integration_test.go index df810c7c6..30c86d7e2 100644 --- a/cmd/monaco/integrationtest/v2/documents_integration_test.go +++ b/cmd/monaco/integrationtest/v2/documents_integration_test.go @@ -21,15 +21,17 @@ package v2 import ( "context" "fmt" + "path/filepath" + "strings" + "testing" + + "github.com/spf13/afero" + "github.com/stretchr/testify/assert" + "github.com/dynatrace/dynatrace-configuration-as-code/v2/cmd/monaco/integrationtest" "github.com/dynatrace/dynatrace-configuration-as-code/v2/cmd/monaco/integrationtest/utils/monaco" "github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/featureflags" manifestloader "github.com/dynatrace/dynatrace-configuration-as-code/v2/pkg/manifest/loader" - "github.com/spf13/afero" - "github.com/stretchr/testify/assert" - "path/filepath" - "strings" - "testing" ) // TestDocuments verifies that the "private" field of a document config definition in the config.yaml file @@ -63,13 +65,13 @@ func TestDocuments(t *testing.T) { // check isPrivate == false clientSet := integrationtest.CreateDynatraceClients(t, man.Environments[environment]) - result, err := clientSet.Document().List(context.TODO(), fmt.Sprintf("name='my-notebook_%s'", testContext.suffix)) + result, err := clientSet.DocumentClient.List(context.TODO(), fmt.Sprintf("name='my-notebook_%s'", testContext.suffix)) assert.NoError(t, err) assert.Len(t, result.Responses, 1) assert.False(t, result.Responses[0].IsPrivate) // check isPrivate == true - result, err = clientSet.Document().List(context.TODO(), fmt.Sprintf("name='my-dashboard_%s'", testContext.suffix)) + result, err = clientSet.DocumentClient.List(context.TODO(), fmt.Sprintf("name='my-dashboard_%s'", testContext.suffix)) assert.NoError(t, err) assert.Len(t, result.Responses, 1) assert.True(t, result.Responses[0].IsPrivate) @@ -101,13 +103,13 @@ func TestDocuments(t *testing.T) { assert.NoError(t, err) // check if isPrivate was changed to true - result, err = clientSet.Document().List(context.TODO(), fmt.Sprintf("name='my-notebook_%s'", testContext.suffix)) + result, err = clientSet.DocumentClient.List(context.TODO(), fmt.Sprintf("name='my-notebook_%s'", testContext.suffix)) assert.NoError(t, err) assert.Len(t, result.Responses, 1) assert.True(t, result.Responses[0].IsPrivate) // check if isPrivate was changed to false - result, err = clientSet.Document().List(context.TODO(), fmt.Sprintf("name='my-dashboard_%s'", testContext.suffix)) + result, err = clientSet.DocumentClient.List(context.TODO(), fmt.Sprintf("name='my-dashboard_%s'", testContext.suffix)) assert.NoError(t, err) assert.Len(t, result.Responses, 1) assert.False(t, result.Responses[0].IsPrivate) diff --git a/pkg/client/clientset.go b/pkg/client/clientset.go index bc7e8a017..57805cc26 100644 --- a/pkg/client/clientset.go +++ b/pkg/client/clientset.go @@ -208,14 +208,6 @@ func (s ClientSet) Bucket() BucketClient { return s.BucketClient } -func (s ClientSet) Document() DocumentClient { - return s.DocumentClient -} - -func (s ClientSet) OpenPipeline() OpenPipelineClient { - return s.OpenPipelineClient -} - type ClientOptions struct { CustomUserAgent string SupportArchive bool