github.com/opentofu/opentofu@v1.7.1/internal/encryption/registry/compliancetest/compliance.go (about)

     1  // Copyright (c) The OpenTofu Authors
     2  // SPDX-License-Identifier: MPL-2.0
     3  // Copyright (c) 2023 HashiCorp, Inc.
     4  // SPDX-License-Identifier: MPL-2.0
     5  
     6  package compliancetest
     7  
     8  import (
     9  	"testing"
    10  
    11  	"github.com/opentofu/opentofu/internal/encryption/registry"
    12  )
    13  
    14  func ComplianceTest(t *testing.T, factory func() registry.Registry) {
    15  	t.Run("returns-registry", func(t *testing.T) {
    16  		reg := factory()
    17  		if reg == nil {
    18  			t.Fatalf("Calling the factory method did not return a valid registry.")
    19  		}
    20  	})
    21  
    22  	t.Run("key_provider", func(t *testing.T) {
    23  		complianceTestKeyProviders(t, factory)
    24  	})
    25  
    26  	t.Run("method", func(t *testing.T) {
    27  		complianceTestMethods(t, factory)
    28  	})
    29  }