Skip to content

Commit

Permalink
Merge branch 'main' of github.com:databricks/terraform-provider-datab…
Browse files Browse the repository at this point in the history
…ricks into bump-sdk-go
  • Loading branch information
tanmay-db committed Jul 9, 2024
2 parents 34d8e4a + ccad28f commit 8fbc2d1
Show file tree
Hide file tree
Showing 55 changed files with 294 additions and 262 deletions.
12 changes: 6 additions & 6 deletions access/resource_ip_access_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"net/http"
"testing"

"github.com/databricks/databricks-sdk-go/apierr"
"github.com/databricks/databricks-sdk-go/service/settings"
"github.com/databricks/terraform-provider-databricks/common"
"github.com/databricks/terraform-provider-databricks/qa"

"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -93,7 +93,7 @@ func TestAPIACLCreate_Error(t *testing.T) {
{
Method: http.MethodPost,
Resource: "/api/2.0/ip-access-lists",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "RESOURCE_ALREADY_EXISTS",
Message: "IP access list with type (" + TestingListTypeString + ") and label (" + TestingLabel + ") already exists",
},
Expand Down Expand Up @@ -185,7 +185,7 @@ func TestIPACLUpdate_Error(t *testing.T) {
ExpectedRequest: settings.UpdateIpAccessList{
Enabled: TestingEnabled,
},
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "SERVER_ERROR",
Message: "Something unexpected happened",
},
Expand Down Expand Up @@ -240,7 +240,7 @@ func TestIPACLRead_NotFound(t *testing.T) {
{
Method: http.MethodGet,
Resource: "/api/2.0/ip-access-lists/" + TestingId + "?",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "RESOURCE_DOES_NOT_EXIST",
Message: "Can't find an IP access list with id: " + TestingId + ".",
},
Expand All @@ -260,7 +260,7 @@ func TestIPACLRead_Error(t *testing.T) {
{
Method: http.MethodGet,
Resource: "/api/2.0/ip-access-lists/" + TestingId + "?",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "SERVER_ERROR",
Message: "Something unexpected happened",
},
Expand Down Expand Up @@ -298,7 +298,7 @@ func TestIPACLDelete_Error(t *testing.T) {
{
Method: http.MethodDelete,
Resource: fmt.Sprintf("/api/2.0/ip-access-lists/%s?", TestingId),
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "INVALID_STATE",
Message: "Something went wrong",
},
Expand Down
14 changes: 7 additions & 7 deletions aws/resource_group_instance_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package aws
import (
"testing"

"github.com/databricks/databricks-sdk-go/apierr"
"github.com/databricks/terraform-provider-databricks/common"
"github.com/databricks/terraform-provider-databricks/scim"

"github.com/databricks/terraform-provider-databricks/qa"
Expand Down Expand Up @@ -56,7 +56,7 @@ func TestResourceGroupInstanceProfileCreate_Error(t *testing.T) {
{
Method: "PATCH",
Resource: "/api/2.0/preview/scim/v2/Groups/abc",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "INVALID_REQUEST",
Message: "Internal error happened",
},
Expand All @@ -80,7 +80,7 @@ func TestResourceGroupInstanceProfileCreate_Error_InvalidARN(t *testing.T) {
{
Method: "PATCH",
Resource: "/api/2.0/preview/scim/v2/Groups/abc",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "INVALID_REQUEST",
Message: "Internal error happened",
},
Expand All @@ -103,7 +103,7 @@ func TestResourceGroupInstanceProfileCreate_Error_OtherARN(t *testing.T) {
{
Method: "PATCH",
Resource: "/api/2.0/preview/scim/v2/Groups/abc",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "INVALID_REQUEST",
Message: "Internal error happened",
},
Expand Down Expand Up @@ -152,7 +152,7 @@ func TestResourceGroupInstanceProfileRead_NotFound(t *testing.T) {
{
Method: "GET",
Resource: "/api/2.0/preview/scim/v2/Groups/abc?attributes=roles",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "NOT_FOUND",
Message: "Item not found",
},
Expand Down Expand Up @@ -192,7 +192,7 @@ func TestResourceGroupInstanceProfileRead_Error(t *testing.T) {
{
Method: "GET",
Resource: "/api/2.0/preview/scim/v2/Groups/abc?attributes=roles",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "INVALID_REQUEST",
Message: "Internal error happened",
},
Expand Down Expand Up @@ -232,7 +232,7 @@ func TestResourceGroupInstanceProfileDelete_Error(t *testing.T) {
{
Method: "PATCH",
Resource: "/api/2.0/preview/scim/v2/Groups/abc",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "INVALID_REQUEST",
Message: "Internal error happened",
},
Expand Down
10 changes: 5 additions & 5 deletions aws/resource_instance_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package aws
import (
"testing"

"github.com/databricks/databricks-sdk-go/apierr"
"github.com/databricks/terraform-provider-databricks/common"
"github.com/databricks/terraform-provider-databricks/qa"

"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -114,7 +114,7 @@ func TestResourceInstanceProfileCreate_Error(t *testing.T) {
{
Method: "POST",
Resource: "/api/2.0/instance-profiles/add",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "INVALID_REQUEST",
Message: "Internal error happened",
},
Expand Down Expand Up @@ -249,7 +249,7 @@ func TestResourceInstanceProfileRead_Error(t *testing.T) {
{
Method: "GET",
Resource: "/api/2.0/instance-profiles/list",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "INVALID_REQUEST",
Message: "Internal error happened",
},
Expand Down Expand Up @@ -289,7 +289,7 @@ func TestResourceInstanceProfileDelete_Error(t *testing.T) {
{
Method: "POST",
Resource: "/api/2.0/instance-profiles/remove",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "INVALID_REQUEST",
Message: "Internal error happened",
},
Expand Down Expand Up @@ -356,7 +356,7 @@ func TestResourceInstanceProfileUpdate_Error(t *testing.T) {
{
Method: "POST",
Resource: "/api/2.0/instance-profiles/edit",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "INVALID_REQUEST",
Message: "Internal error happened",
},
Expand Down
6 changes: 3 additions & 3 deletions aws/resource_service_principal_role_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package aws
import (
"testing"

"github.com/databricks/databricks-sdk-go/apierr"
"github.com/databricks/terraform-provider-databricks/common"
"github.com/databricks/terraform-provider-databricks/scim"

"github.com/databricks/terraform-provider-databricks/qa"
Expand Down Expand Up @@ -53,7 +53,7 @@ func TestResourceServicePrincipalRoleCreate_Error(t *testing.T) {
{
Method: "PATCH",
Resource: "/api/2.0/preview/scim/v2/ServicePrincipals/abc",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "INVALID_REQUEST",
Message: "Internal error happened",
},
Expand Down Expand Up @@ -119,7 +119,7 @@ func TestResourceServicePrincipalRoleRead_NotFound(t *testing.T) {
{
Method: "GET",
Resource: "/api/2.0/preview/scim/v2/ServicePrincipals/abc?attributes=roles",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "NOT_FOUND",
Message: "Item not found",
},
Expand Down
10 changes: 5 additions & 5 deletions aws/resource_user_instance_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package aws
import (
"testing"

"github.com/databricks/databricks-sdk-go/apierr"
"github.com/databricks/terraform-provider-databricks/common"
"github.com/databricks/terraform-provider-databricks/scim"

"github.com/databricks/terraform-provider-databricks/qa"
Expand Down Expand Up @@ -68,7 +68,7 @@ func TestResourceUserInstanceProfileCreate_Error(t *testing.T) {
{
Method: "PATCH",
Resource: "/api/2.0/preview/scim/v2/Users/abc",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "INVALID_REQUEST",
Message: "Internal error happened",
},
Expand Down Expand Up @@ -138,7 +138,7 @@ func TestResourceUserInstanceProfileRead_NotFound(t *testing.T) {
{
Method: "GET",
Resource: "/api/2.0/preview/scim/v2/Users/abc?attributes=roles",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "NOT_FOUND",
Message: "Item not found",
},
Expand All @@ -158,7 +158,7 @@ func TestResourceUserInstanceProfileRead_Error(t *testing.T) {
{
Method: "GET",
Resource: "/api/2.0/preview/scim/v2/Users/abc?attributes=roles",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "INVALID_REQUEST",
Message: "Internal error happened",
},
Expand Down Expand Up @@ -198,7 +198,7 @@ func TestResourceUserInstanceProfileDelete_Error(t *testing.T) {
{
Method: "PATCH",
Resource: "/api/2.0/preview/scim/v2/Users/abc",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "INVALID_REQUEST",
Message: "Internal error happened",
},
Expand Down
10 changes: 5 additions & 5 deletions catalog/resource_artifact_allowlist_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"net/http"
"testing"

"github.com/databricks/databricks-sdk-go/apierr"
"github.com/databricks/databricks-sdk-go/service/catalog"
"github.com/databricks/terraform-provider-databricks/common"
"github.com/databricks/terraform-provider-databricks/qa"
"github.com/stretchr/testify/assert"
)
Expand Down Expand Up @@ -105,7 +105,7 @@ func TestArtifactAllowlistCreate_Error(t *testing.T) {
Method: http.MethodPut,
Resource: "/api/2.1/unity-catalog/artifact-allowlists/INIT_SCRIPT",
ExpectedRequest: setArtifact,
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "SERVER_ERROR",
Message: "Something unexpected happened",
},
Expand Down Expand Up @@ -156,7 +156,7 @@ func TestResourceArtifactAllowlistRead_Error(t *testing.T) {
{
Method: "GET",
Resource: "/api/2.1/unity-catalog/artifact-allowlists/INIT_SCRIPT?",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "INVALID_REQUEST",
Message: "Internal error happened",
},
Expand Down Expand Up @@ -219,7 +219,7 @@ func TestArtifactAllowlistUpdate_Error(t *testing.T) {
Method: http.MethodPut,
Resource: "/api/2.1/unity-catalog/artifact-allowlists/INIT_SCRIPT",
ExpectedRequest: updateArtifact,
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "SERVER_ERROR",
Message: "Something unexpected happened",
},
Expand Down Expand Up @@ -280,7 +280,7 @@ func TestArtifactAllowlistDelete_Error(t *testing.T) {
ArtifactType: catalog.ArtifactTypeInitScript,
ArtifactMatchers: []catalog.ArtifactMatcher{},
},
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "INVALID_STATE",
Message: "Something went wrong",
},
Expand Down
10 changes: 5 additions & 5 deletions catalog/resource_connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"net/http"
"testing"

"github.com/databricks/databricks-sdk-go/apierr"
"github.com/databricks/databricks-sdk-go/service/catalog"
"github.com/databricks/terraform-provider-databricks/common"
"github.com/databricks/terraform-provider-databricks/qa"
"github.com/stretchr/testify/assert"
)
Expand Down Expand Up @@ -145,7 +145,7 @@ func TestConnectionsCreate_Error(t *testing.T) {
"host": "test.com",
},
},
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "SERVER_ERROR",
Message: "Something unexpected happened",
},
Expand Down Expand Up @@ -210,7 +210,7 @@ func TestConnectionRead_Error(t *testing.T) {
{
Method: "GET",
Resource: "/api/2.1/unity-catalog/connections/testConnectionName?",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "INVALID_REQUEST",
Message: "Internal error happened",
},
Expand Down Expand Up @@ -395,7 +395,7 @@ func TestConnectionUpdate_Error(t *testing.T) {
"host": "test.com",
},
},
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "SERVER_ERROR",
Message: "Something unexpected happened",
},
Expand Down Expand Up @@ -443,7 +443,7 @@ func TestConnectionDelete_Error(t *testing.T) {
{
Method: http.MethodDelete,
Resource: "/api/2.1/unity-catalog/connections/testConnectionName?",
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "INVALID_STATE",
Message: "Something went wrong",
},
Expand Down
8 changes: 4 additions & 4 deletions catalog/resource_external_location_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"fmt"
"testing"

"github.com/databricks/databricks-sdk-go/apierr"
"github.com/databricks/databricks-sdk-go/experimental/mocks"
"github.com/databricks/databricks-sdk-go/service/catalog"
"github.com/databricks/terraform-provider-databricks/common"
"github.com/databricks/terraform-provider-databricks/qa"
"github.com/stretchr/testify/mock"
)
Expand Down Expand Up @@ -450,7 +450,7 @@ func TestUpdateExternalLocationRollback(t *testing.T) {
Url: "s3://foo/bar",
CredentialName: "xyz",
},
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "SERVER_ERROR",
Message: "Something unexpected happened",
},
Expand Down Expand Up @@ -514,7 +514,7 @@ func TestUpdateExternalLocationRollbackError(t *testing.T) {
Url: "s3://foo/bar",
CredentialName: "xyz",
},
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "SERVER_ERROR",
Message: "Something unexpected happened",
},
Expand All @@ -526,7 +526,7 @@ func TestUpdateExternalLocationRollbackError(t *testing.T) {
ExpectedRequest: catalog.UpdateExternalLocation{
Owner: "administrators",
},
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "INVALID_REQUEST",
Message: "Internal error happened",
},
Expand Down
4 changes: 2 additions & 2 deletions catalog/resource_storage_credential_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package catalog
import (
"testing"

"github.com/databricks/databricks-sdk-go/apierr"
"github.com/databricks/databricks-sdk-go/experimental/mocks"
"github.com/databricks/databricks-sdk-go/service/catalog"
"github.com/databricks/terraform-provider-databricks/common"
"github.com/databricks/terraform-provider-databricks/qa"
"github.com/stretchr/testify/mock"
)
Expand Down Expand Up @@ -506,7 +506,7 @@ func TestUpdateStorageCredentialsRollback(t *testing.T) {
RoleArn: "CHANGED",
},
},
Response: apierr.APIErrorBody{
Response: common.APIErrorBody{
ErrorCode: "SERVER_ERROR",
Message: "Something unexpected happened",
},
Expand Down
Loading

0 comments on commit 8fbc2d1

Please sign in to comment.