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: vault_loader_test.go
    path of file: ./repos/acra/keystore/keyloader/hashicorp
    
    the code of the file until where you have to start completion: //go:build integration && vault
// +build integration,vault

package hashicorp

import (
	"encoding/base64"
	"fmt"
	"os"
	"path/filepath"
	"strings"
	"testing"
	"time"

	"github.com/cossacklab
    
func TestVaultLoaderV2Engine(t *testing.T) {
	vaultManager := newTestVaultManager(t)

	vaultLoader := VaultLoader{
		client: vaultManager.client,
	}

	var expectedNil *keystore.SerializedKeys

	path := "kv_path_v2/"
	tearDown, err := vaultManager.mountKVEngine(path, kvSecretEngineVersion2)
	if err != nil {
		t.Fatal(err)
	}
	defer tearDown(t)

	t.Run("Successfully get secret engine", func(t *testing.T) {
		vaultLoader.secretPath = path

		engine, err := vaultLoader.getKVEngine()
		assert.NoError(t, err)
		assert.Equal(t, kvSecretEngineType, engine.secretType)
		assert.Equal(t, kvSecretEngineVersion2, engine.version)
		assert.Contains(t, engine.path, path)
	})

	t.Run("Search unmount path error", func(t *testing.T) {
		vaultLoader.secretPath = "test_path"

		engine, err := vaultLoader.getKVEngine()
		assert.Equal(t, ErrEngineNotFound, err)
		assert.Equal(t, engine, secretEngine{})
	})

	t.Run("getKVEngine() error", func(t *testing.T) {
		vaultLoader.secretPath = "test_path"

		key, err := vaultLoader.getSecretKey()
		assert.Equal(t, ErrEngineNotFound, err)
		assert.Equal(t, "", key)
	})

	t.Run("No key found error", func(t *testing.T) {
		vaultLoader.secretPath = "kv_path_v2/foo"

		key, err := vaultLoader.getSecretKey()
		assert.Equal(t, ErrSecretNotFound, err)
		assert.Equal(t, "", key)
	})

	t.Run("masterKeySecretID not found error (version 2)", func(t *testing.T) {
		writePath := filepath.Join(path, "data", "key")
		secretPath := filepath.Join(path, "key")

		tearDownPut, err := vaultManager.putSecretByPath(writePath, "invalid_key_id", "value")
		if err != nil {
			t.Fatal(err)
		}
		defer tearDownPut(t)

		vaultLoader.secretPath = secretPath

		key, err := vaultLoader.getSecretKey()
		assert.Equal(t, ErrMasterKeyNotFound, err)
		assert.Equal(t, "", key)
	})

	t.Run("convert ACRA_MASTER_KEY to string error", func(t *testing.T) {
		writePath := filepath.Join(path, "data", "key")
		secretPath := filepath.Join(path, "key")

		tearDownPut, err := vaultManager.putSecretByPath(writePath, masterKeySecretID, 444)
		if err != nil {
			t.Fatal(err)
		}
		defer tearDownPut(t)

		vaultLoader.secretPath = secretPath

		key, err := vaultLoader.getSecretKey()
		assert.Equal(t, ErrMasterKeyConvert, err)
		assert.Equal(t, "", key)
	})

	t.Run("getSecretKey() success (version 2)", func(t *testing.T) {
		writePath := filepath.Join(path, "data", "key")
		secretPath := filepath.Join(path, "key")

		masterKey := "master_key_value"
		tearDownPut, err := vaultManager.putSecretByPath(writePath, masterKeySecretID, masterKey)
		if err != nil {
			t.Fatal(err)
		}
		defer tearDownPut(t)

		vaultLoader.secretPath = secretPath

		key, err := vaultLoader.getSecretKey()
		assert.NoError(t, err)
		assert.Equal(t, masterKey, key)
	})

	t.Run("base64 decode error", func(t *testing.T) {
		writePath := filepath.Join(path, "data", "foo")

		masterKey := "master_key_value"
		tearDownPut, err := vaultManager.putSecretByPath(writePath, masterKeySecretID, masterKey)
		if err != nil {
			t.Fatal(err)
		}
		defer tearDownPut(t)

		vaultLoader.secretPath = "kv_path_v2/foo"

		keys, err := vaultLoader.getSecretKeys()
		assert.Equal(t, base64.CorruptInputError(6), err)
		assert.Equal(t, expectedNil, keys)
	})

	t.Run("deserialize to SerializedKeys error", func(t *testing.T) {

		writePath := filepath.Join(path, "data", "foo")

		masterKey := base64.StdEncoding.EncodeToString([]byte("master_key_value"))
		tearDownPut, err := vaultManager.putSecretByPath(writePath, masterKeySecretID, masterKey)
		if err != nil {
			t.Fatal(err)
		}
		defer tearDownPut(t)

		vaultLoader.secretPath = "kv_path_v2/foo"

		keys, err := vaultLoader.getSecretKeys()
		assert.Error(t, err)
		assert.Equal(t, expectedNil, keys)
	})
}