Skip to content

Commit

Permalink
updated test to perform update
Browse files Browse the repository at this point in the history
  • Loading branch information
benPearce1 committed Nov 28, 2024
1 parent b834bc4 commit 91da299
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions octopusdeploy_framework/resource_deployment_freeze_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ func TestNewDeploymentFreezeResource(t *testing.T) {
name := acctest.RandStringFromCharSet(20, acctest.CharSetAlpha)
start := fmt.Sprintf("%d-11-21T06:30:00+10:00", time.Now().Year()+1)
end := fmt.Sprintf("%d-11-21T08:30:00+10:00", time.Now().Year()+1)
updatedEnd := fmt.Sprintf("%d-11-21T08:30:00+10:00", time.Now().Year()+2)
projectName := acctest.RandStringFromCharSet(20, acctest.CharSetAlpha)
environmentName1 := acctest.RandStringFromCharSet(20, acctest.CharSetAlpha)
environmentName2 := acctest.RandStringFromCharSet(20, acctest.CharSetAlpha)
Expand All @@ -37,21 +38,13 @@ func TestNewDeploymentFreezeResource(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "end", end)),
Config: testDeploymentFreezeBasic(localName, name, start, end, spaceName, []string{environmentName1}, projectName, projectGroupName, lifecycleName),
},
},
})

resource.Test(t, resource.TestCase{
CheckDestroy: testDeploymentFreezeCheckDestroy,
PreCheck: func() { TestAccPreCheck(t) },
ProtoV6ProviderFactories: ProtoV6ProviderFactories(),
Steps: []resource.TestStep{
{
Check: resource.ComposeTestCheckFunc(
testDeploymentFreezeExists(resourceName),
resource.TestCheckResourceAttr(resourceName, "name", name),
resource.TestCheckResourceAttr(resourceName, "name", name+"1"),
resource.TestCheckResourceAttr(resourceName, "start", start),
resource.TestCheckResourceAttr(resourceName, "end", end)),
Config: testDeploymentFreezeBasic(localName, name, start, end, spaceName, []string{environmentName1, environmentName2}, projectName, projectGroupName, lifecycleName),
resource.TestCheckResourceAttr(resourceName, "end", updatedEnd)),
Config: testDeploymentFreezeBasic(localName, name+"1", start, updatedEnd, spaceName, []string{environmentName1, environmentName2}, projectName, projectGroupName, lifecycleName),
},
},
})
Expand Down

0 comments on commit 91da299

Please sign in to comment.