mock_entity

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: GPL-3.0 Imports: 4 Imported by: 0

README

Aerospike Entity Mocks

Import path: github.com/InsideGallery/core/db/aerospike/entity/mocks

This package contains generated GoMock support for tests that depend on the legacy entity.Operations interface. The generated package name is mock_entity, so consumers usually import it with an alias.

Main APIs

  • NewMockOperations(ctrl) creates a mock implementation of entity.Operations.
  • MockOperations.EXPECT() returns the recorder used to declare expected calls.
  • Generated expectations cover Execute, Exists, Get, GetBin, and GetNamespace.

Usage

package example_test

import (
	"testing"

	mockentity "github.com/InsideGallery/core/db/aerospike/entity/mocks"
	"github.com/golang/mock/gomock"
)

func TestUsesEntityOperations(t *testing.T) {
	ctrl := gomock.NewController(t)
	defer ctrl.Finish()

	operations := mockentity.NewMockOperations(ctrl)
	operations.EXPECT().GetBin("status").Return("active", nil)

	// Pass operations to code that accepts entity.Operations.
}

Operational Notes

This package is for tests only. Do not edit models.go by hand; it is generated from db/aerospike/entity/operations.go.

Documentation

Overview

Package mock_entity is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockOperations

type MockOperations struct {
	// contains filtered or unexported fields
}

MockOperations is a mock of Operations interface.

func NewMockOperations

func NewMockOperations(ctrl *gomock.Controller) *MockOperations

NewMockOperations creates a new mock instance.

func (*MockOperations) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockOperations) Execute

func (m *MockOperations) Execute(arg0 []*aerospike0.Operation) error

Execute mocks base method.

func (*MockOperations) Exists

func (m *MockOperations) Exists() (bool, aerospike0.Error)

Exists mocks base method.

func (*MockOperations) Get

func (m *MockOperations) Get(bins ...string) (*aerospike0.Record, error)

Get mocks base method.

func (*MockOperations) GetBin

func (m *MockOperations) GetBin(binName string) (interface{}, error)

GetBin mocks base method.

func (*MockOperations) GetNamespace

func (m *MockOperations) GetNamespace() aerospike.Namespace

GetNamespace mocks base method.

type MockOperationsMockRecorder

type MockOperationsMockRecorder struct {
	// contains filtered or unexported fields
}

MockOperationsMockRecorder is the mock recorder for MockOperations.

func (*MockOperationsMockRecorder) Execute

func (mr *MockOperationsMockRecorder) Execute(arg0 interface{}) *gomock.Call

Execute indicates an expected call of Execute.

func (*MockOperationsMockRecorder) Exists

func (mr *MockOperationsMockRecorder) Exists() *gomock.Call

Exists indicates an expected call of Exists.

func (*MockOperationsMockRecorder) Get

func (mr *MockOperationsMockRecorder) Get(bins ...interface{}) *gomock.Call

Get indicates an expected call of Get.

func (*MockOperationsMockRecorder) GetBin

func (mr *MockOperationsMockRecorder) GetBin(binName interface{}) *gomock.Call

GetBin indicates an expected call of GetBin.

func (*MockOperationsMockRecorder) GetNamespace

func (mr *MockOperationsMockRecorder) GetNamespace() *gomock.Call

GetNamespace indicates an expected call of GetNamespace.

Jump to

Keyboard shortcuts

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