Skip to content

Commit

Permalink
azuread_application_certificate / azuread_service_principal_certifica…
Browse files Browse the repository at this point in the history
…te: Calculate earlier certificate end_date to accommodate timezone drift when running aceptance tests
  • Loading branch information
manicminer committed Jun 2, 2020
1 parent 173098a commit 6658b42
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions azuread/resource_application_certificate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func TestAccAzureADApplicationCertificate_basic(t *testing.T) {
resourceName := "azuread_application_certificate.test"
ri := tf.AccRandTimeInt()
keyType := "AsymmetricX509Cert"
endDate := time.Now().AddDate(0, 0, 364).UTC().Format(time.RFC3339)
endDate := time.Now().AddDate(0, 0, 360).UTC().Format(time.RFC3339)
value := testCertificateApplication

resource.ParallelTest(t, resource.TestCase{
Expand Down Expand Up @@ -133,7 +133,7 @@ func TestAccAzureADApplicationCertificate_complete(t *testing.T) {
keyId := uuid.New().String()
keyType := "AsymmetricX509Cert"
startDate := time.Now().AddDate(0, 0, 7).UTC().Format(time.RFC3339)
endDate := time.Now().AddDate(0, 0, 364).UTC().Format(time.RFC3339)
endDate := time.Now().AddDate(0, 0, 360).UTC().Format(time.RFC3339)
value := testCertificateApplication

resource.ParallelTest(t, resource.TestCase{
Expand Down Expand Up @@ -195,7 +195,7 @@ func TestAccAzureADApplicationCertificate_requiresImport(t *testing.T) {
resourceName := "azuread_application_certificate.test"
ri := tf.AccRandTimeInt()
keyType := "AsymmetricX509Cert"
endDate := time.Now().AddDate(0, 0, 364).UTC().Format(time.RFC3339)
endDate := time.Now().AddDate(0, 0, 360).UTC().Format(time.RFC3339)
value := testCertificateApplication

resource.ParallelTest(t, resource.TestCase{
Expand Down
6 changes: 3 additions & 3 deletions azuread/resource_service_principal_certificate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func TestAccAzureADServicePrincipalCertificate_basic(t *testing.T) {
resourceName := "azuread_service_principal_certificate.test"
ri := tf.AccRandTimeInt()
keyType := "AsymmetricX509Cert"
endDate := time.Now().AddDate(0, 0, 364).UTC().Format(time.RFC3339)
endDate := time.Now().AddDate(0, 0, 360).UTC().Format(time.RFC3339)
value := testCertificateServicePrincipal

resource.ParallelTest(t, resource.TestCase{
Expand Down Expand Up @@ -133,7 +133,7 @@ func TestAccAzureADServicePrincipalCertificate_complete(t *testing.T) {
keyId := uuid.New().String()
keyType := "AsymmetricX509Cert"
startDate := time.Now().AddDate(0, 0, 7).UTC().Format(time.RFC3339)
endDate := time.Now().AddDate(0, 0, 364).UTC().Format(time.RFC3339)
endDate := time.Now().AddDate(0, 0, 360).UTC().Format(time.RFC3339)
value := testCertificateServicePrincipal

resource.ParallelTest(t, resource.TestCase{
Expand Down Expand Up @@ -195,7 +195,7 @@ func TestAccAzureADServicePrincipalCertificate_requiresImport(t *testing.T) {
resourceName := "azuread_service_principal_certificate.test"
ri := tf.AccRandTimeInt()
keyType := "AsymmetricX509Cert"
endDate := time.Now().AddDate(0, 0, 364).UTC().Format(time.RFC3339)
endDate := time.Now().AddDate(0, 0, 360).UTC().Format(time.RFC3339)
value := testCertificateServicePrincipal

resource.ParallelTest(t, resource.TestCase{
Expand Down

0 comments on commit 6658b42

Please sign in to comment.