You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: apply_test.go
    path of file: ./repos/cockroach/pkg/kv/kvserver/loqrecovery
    
    the code of the file until where you have to start completion: // Copyright 2022 The Cockroach Authors.
//
// Use of this software is governed by the Business Source Lic
    
func TestApplyVerifiesVersion(t *testing.T) {
	defer leaktest.AfterTest(t)()
	ctx := context.Background()

	testTime, _ := time.Parse(time.RFC3339, "2022-02-24T01:40:00Z")
	clock := timeutil.NewManualTime(testTime)
	ps := NewPlanStore("", vfs.NewMem())
	cid := uuid.MakeV4()
	engines := []storage.Engine{
		createEngineOrFatal(ctx, t, cid, 1),
		createEngineOrFatal(ctx, t, cid, 2),
	}
	defer engines[1].Close()
	defer engines[0].Close()

	assertPlanError := func(t *testing.T, plan loqrecoverypb.ReplicaUpdatePlan, errMsg string) {
		require.NoError(t, ps.SavePlan(plan), "failed to stage plan")
		err := MaybeApplyPendingRecoveryPlan(ctx, ps, engines, clock)
		require.NoError(t, err, "fatal error applying recovery plan")
		report, ok, err := readNodeRecoveryStatusInfo(ctx, engines[0])
		require.NoError(t, err, "failed to read application outcome")
		require.True(t, ok, "didn't find application outcome in engine")
		require.NotEmpty(t, report.AppliedPlanID, "plan was not processed")
		require.Contains(t, report.Error, errMsg, "version error not registered")
	}

	t.Run("apply plan version is higher than cluster", func(t *testing.T) {
		aboveCurrent := clusterversion.Latest.Version()
		aboveCurrent.Major += 1
		plan := loqrecoverypb.ReplicaUpdatePlan{
			PlanID:    uuid.MakeV4(),
			ClusterID: cid.String(),
			Version:   aboveCurrent,
		}
		assertPlanError(t, plan, "doesn't match cluster active version")
	})

	t.Run("apply plan version lower than current", func(t *testing.T) {
		belowMin := clusterversion.MinSupported.Version()
		belowMin.Minor -= 1
		plan := loqrecoverypb.ReplicaUpdatePlan{
			PlanID:    uuid.MakeV4(),
			ClusterID: cid.String(),
			Version:   belowMin,
		}
		assertPlanError(t, plan, "doesn't match cluster active version")
	})
}