Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tankilevitch committed Aug 4, 2024
1 parent 45965d4 commit a0bcae8
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions port/integration/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func createIntegration(
resource "port_integration" "kafkush" {
installation_id = "%s"
installation_app_type = "%s"
title = "ZOMG"
title = "my-kafka-cluster"
version = "1.33.7"
config = jsonencode({
deleteDependentEntities = true,
Expand Down Expand Up @@ -54,7 +54,7 @@ func createIntegrationWithWebHook(
return fmt.Sprintf(`
resource "port_integration" "kafkush" {
installation_id = "%s"
title = "ZOMG"
title = "my-kafka-cluster"
version = "1.33.7"
installation_app_type = "%s"
config = jsonencode({
Expand Down Expand Up @@ -107,7 +107,7 @@ func TestPortIntegrationBasic(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("port_integration.kafkush", "installation_id", integrationIdentifier),
resource.TestCheckResourceAttr("port_integration.kafkush", "installation_app_type", installationAppType),
resource.TestCheckResourceAttr("port_integration.kafkush", "title", "ZOMG"),
resource.TestCheckResourceAttr("port_integration.kafkush", "title", "my-kafka-cluster"),
resource.TestCheckResourceAttr("port_integration.kafkush", "version", "1.33.7"),
resource.TestCheckResourceAttr("port_integration.kafkush", "webhook_changelog_destination.%", "0"),
),
Expand All @@ -116,7 +116,7 @@ func TestPortIntegrationBasic(t *testing.T) {
Config: testAccBaseIntegrationPermissionsConfigUpdate,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("port_integration.kafkush", "installation_id", integrationIdentifier),
resource.TestCheckResourceAttr("port_integration.kafkush", "title", "ZOMG"),
resource.TestCheckResourceAttr("port_integration.kafkush", "title", "my-kafka-cluster"),
resource.TestCheckResourceAttr("port_integration.kafkush", "version", "1.33.8"),
resource.TestCheckResourceAttr("port_integration.kafkush", "webhook_changelog_destination.%", "0"),
),
Expand All @@ -134,7 +134,7 @@ func TestPortIntegrationPatchTitleNull(t *testing.T) {
}
var testPortIntegrationResourceBasic = createIntegration(integrationIdentifier, installationAppType)

var testAccBaseIntegrationPermissionsConfigUpdate = strings.Replace(testPortIntegrationResourceBasic, "ZOMG", "null", -1)
var testAccBaseIntegrationPermissionsConfigUpdate = strings.Replace(testPortIntegrationResourceBasic, "\"my-kafka-cluster\"", "null", -1)

resource.Test(t, resource.TestCase{
PreCheck: func() { acctest.TestAccPreCheck(t) },
Expand All @@ -145,7 +145,7 @@ func TestPortIntegrationPatchTitleNull(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("port_integration.kafkush", "installation_id", integrationIdentifier),
resource.TestCheckResourceAttr("port_integration.kafkush", "installation_app_type", installationAppType),
resource.TestCheckResourceAttr("port_integration.kafkush", "title", "ZOMG"),
resource.TestCheckResourceAttr("port_integration.kafkush", "title", "my-kafka-cluster"),
resource.TestCheckResourceAttr("port_integration.kafkush", "version", "1.33.7"),
resource.TestCheckResourceAttr("port_integration.kafkush", "webhook_changelog_destination.%", "0"),
),
Expand All @@ -155,7 +155,7 @@ func TestPortIntegrationPatchTitleNull(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("port_integration.kafkush", "installation_id", integrationIdentifier),
resource.TestCheckResourceAttr("port_integration.kafkush", "installation_app_type", installationAppType),
resource.TestCheckResourceAttr("port_integration.kafkush", "title", "null"),
resource.TestCheckNoResourceAttr("port_integration.kafkush", "title"),
resource.TestCheckResourceAttr("port_integration.kafkush", "version", "1.33.7"),
resource.TestCheckResourceAttr("port_integration.kafkush", "webhook_changelog_destination.%", "0"),
),
Expand All @@ -170,7 +170,7 @@ func TestPortIntegrationWithWebhook(t *testing.T) {
if err != nil {
t.Fatal(err)
}
var testPortIntegrationResourceBasic = createIntegrationWithWebHook(integrationIdentifier, "KAFKA")
var testPortIntegrationResourceBasic = createIntegrationWithWebHook(integrationIdentifier, "kafka")

resource.Test(t, resource.TestCase{
PreCheck: func() { acctest.TestAccPreCheck(t) },
Expand All @@ -180,9 +180,9 @@ func TestPortIntegrationWithWebhook(t *testing.T) {
Config: testPortIntegrationResourceBasic,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("port_integration.kafkush", "installation_id", integrationIdentifier),
resource.TestCheckResourceAttr("port_integration.kafkush", "title", "ZOMG"),
resource.TestCheckResourceAttr("port_integration.kafkush", "title", "my-kafka-cluster"),
resource.TestCheckResourceAttr("port_integration.kafkush", "version", "1.33.7"),
resource.TestCheckResourceAttr("port_integration.kafkush", "installation_app_type", "KAFKA"),
resource.TestCheckResourceAttr("port_integration.kafkush", "installation_app_type", "kafka"),
resource.TestCheckResourceAttr("port_integration.kafkush", "webhook_changelog_destination.%", "2"),
resource.TestCheckResourceAttr("port_integration.kafkush", "webhook_changelog_destination.url", "https://google.com"),
resource.TestCheckResourceAttr("port_integration.kafkush", "webhook_changelog_destination.agent", "true"),
Expand All @@ -194,15 +194,15 @@ func TestPortIntegrationWithWebhook(t *testing.T) {

func TestPortIntegrationImport(t *testing.T) {
integrationIdentifier := utils.GenID()
var testPortIntegrationResourceBasic = createIntegrationWithWebHook(integrationIdentifier, "KAFKA")
var testPortIntegrationResourceBasic = createIntegrationWithWebHook(integrationIdentifier, "kafka")
resource.Test(t, resource.TestCase{
PreCheck: func() { acctest.TestAccPreCheck(t) },
ProtoV6ProviderFactories: acctest.TestAccProtoV6ProviderFactories,
Steps: []resource.TestStep{
{
Config: acctest.ProviderConfig + testPortIntegrationResourceBasic,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("port_integration.kafkush", "installation_app_type", "KAFKA"),
resource.TestCheckResourceAttr("port_integration.kafkush", "installation_app_type", "kafka"),
resource.TestCheckResourceAttr("port_integration.kafkush", "installation_id", integrationIdentifier),
),
},
Expand Down

0 comments on commit a0bcae8

Please sign in to comment.