When mocking data for tests in OPA, it can be useful to understand the exact OPA flags that Terraform Cloud uses for its OPA runs in your testing.
In addition to Terraform plan JSON data, OPA is additionally provided metadata around the run as outlined here.
If your policies are VCS based, Terraform cloud uses the following flags:
opa eval -f pretty --fail -i <input_path> -b <policy_set_path_for vcs> <query>
If your policies are managed/non VCS based, the structure is:
opa eval -f pretty --fail -i <input_path> -d <policy_path> <query>