I maintain a Terraform provider, and we are migrating to the plugin framework from SDKv2. I’ve read the advice in the docs about acceptance testing (Plugin Development - Framework: Acceptance Tests | Terraform | HashiCorp Developer), and the general approach we are considering is to primarily use the terraform-plugin-testing framework for acceptance tests, and to use standard Go tests for internal logic.
However, it seems somewhat cumbersome to write unit tests directly against the Resource & DataSource interfaces. These interfaces use types from the tfsdk package (Config, State, and Plan), which require some boilerplate setup (need to read/compute the schema, construct a tftypes.Value, build the desired Config/Plan, then build the desired *Request).
It would be nice to be able to write tests of the form: “Given a plan + a mock for services that this resource interacts with, the resulting state matches an expected value.” Is there any guidance if we want to call these methods directly in a unit test? Is there a recommended way to structure provider implementations for easy unit testability? Or is it not recommended to do this at all?