Skip to content

Commit

Permalink
added tests and did some renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
yairsimantov20 committed Feb 8, 2024
1 parent 4a3e0f1 commit 2e90a44
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/defaults/defaults_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ func Test_InitIntegration_LocalResourcesConfiguration_ExistingIntegration_EmptyC

func Test_InitIntegration_LocalResourcesConfiguration_ExistingIntegration_WithConfiguration_WithOverwriteConfigurationOnRestartFlag(t *testing.T) {
f := NewFixture(t)
expectedResources := &port.IntegrationAppConfig{
expectedConfig := &port.IntegrationAppConfig{
Resources: []port.Resource{
{
Kind: "workload",
Expand All @@ -278,24 +278,24 @@ func Test_InitIntegration_LocalResourcesConfiguration_ExistingIntegration_WithCo
},
},
}
err := integration.CreateIntegration(f.portClient, f.stateKey, "POLLING", expectedResources)
err := integration.CreateIntegration(f.portClient, f.stateKey, "POLLING", expectedConfig)
if err != nil {
t.Errorf("Error creating Port integration: %s", err.Error())
}

expectedResources.Resources[0].Kind = "namespace"
expectedConfig.Resources[0].Kind = "namespace"
e := InitIntegration(f.portClient, &port.Config{
StateKey: f.stateKey,
EventListenerType: "KAFKA",
Resources: expectedResources.Resources,
Resources: expectedConfig.Resources,
CreateDefaultResources: true,
OverwriteConfigurationOnRestart: true,
})
assert.Nil(t, e)

i, err := integration.GetIntegration(f.portClient, f.stateKey)
assert.Nil(t, err)
assert.Equal(t, expectedResources, i.Config.Resources)
assert.Equal(t, expectedConfig.Resources, i.Config.Resources)

checkResourcesDoesNotExist(f, []string{"workload", "namespace", "cluster"}, []string{"workload_overview_dashboard", "availability_scorecard_dashboard"})
}

0 comments on commit 2e90a44

Please sign in to comment.