testutil

package
v0.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package testutil provides utilities that are intended to enable easier and more concise writing of unit test code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockKeyManagementServer

type MockKeyManagementServer struct {
	// Embed for forward compatibility.
	// Tests will keep working if more methods are added
	// in the future.
	kmspb.UnimplementedKeyManagementServiceServer

	Reqs []proto.Message

	// If set, all calls return this error.
	Err error

	// responses to return if err == nil
	Resps []proto.Message

	Labels map[string]string

	PrivateKey  *ecdsa.PrivateKey
	PublicKey   string
	KeyName     string
	VersionName string
	NumVersions int
	// contains filtered or unexported fields
}

func NewMockKeyManagementServer

func NewMockKeyManagementServer(keyName, versionName, primary string) *MockKeyManagementServer

NewMockKeyManagementServer sets up a mock KMS server with required values for use in testing.

func (*MockKeyManagementServer) AsymmetricSign

func (*MockKeyManagementServer) CreateCryptoKeyVersion

func (*MockKeyManagementServer) DestroyCryptoKeyVersion

func (*MockKeyManagementServer) GetCryptoKey

func (*MockKeyManagementServer) GetCryptoKeyVersion

func (*MockKeyManagementServer) GetPublicKey

func (*MockKeyManagementServer) ListCryptoKeyVersions

func (*MockKeyManagementServer) UpdateCryptoKey

func (*MockKeyManagementServer) UpdateCryptoKeyVersion

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL