@@ -11,6 +11,7 @@ import (
1111
1212 "github.com/google/go-cmp/cmp"
1313 "github.com/hashicorp/terraform-plugin-go/tftypes"
14+ tfrefinement "github.com/hashicorp/terraform-plugin-go/tftypes/refinement"
1415
1516 "github.com/hashicorp/terraform-plugin-framework/attr"
1617 "github.com/hashicorp/terraform-plugin-framework/diag"
@@ -490,6 +491,40 @@ func TestAttributeValidate(t *testing.T) {
490491 },
491492 resp : ValidateAttributeResponse {},
492493 },
494+ "deprecation-message-unknown-with-not-null-refinement" : {
495+ req : ValidateAttributeRequest {
496+ AttributePath : path .Root ("test" ),
497+ Config : tfsdk.Config {
498+ Raw : tftypes .NewValue (tftypes.Object {
499+ AttributeTypes : map [string ]tftypes.Type {
500+ "test" : tftypes .String ,
501+ },
502+ }, map [string ]tftypes.Value {
503+ "test" : tftypes .NewValue (tftypes .String , tftypes .UnknownValue ).Refine (tfrefinement.Refinements {
504+ tfrefinement .KeyNullness : tfrefinement .NewNullness (false ),
505+ }),
506+ }),
507+ Schema : testschema.Schema {
508+ Attributes : map [string ]fwschema.Attribute {
509+ "test" : testschema.Attribute {
510+ Type : types .StringType ,
511+ Optional : true ,
512+ DeprecationMessage : "Use something else instead." ,
513+ },
514+ },
515+ },
516+ },
517+ },
518+ resp : ValidateAttributeResponse {
519+ Diagnostics : diag.Diagnostics {
520+ diag .NewAttributeWarningDiagnostic (
521+ path .Root ("test" ),
522+ "Attribute Deprecated" ,
523+ "Use something else instead." ,
524+ ),
525+ },
526+ },
527+ },
493528 "deprecation-message-dynamic-underlying-value-unknown" : {
494529 req : ValidateAttributeRequest {
495530 AttributePath : path .Root ("test" ),
0 commit comments