github.com/observiq/bindplane-agent@v1.51.0/internal/report/snapshot/mocks/mock_snapshotter.go (about)

     1  // Copyright  observIQ, Inc.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //      http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  // Package mocks contains mocks for snapshot interfaces
    16  package mocks
    17  
    18  import (
    19  	mock "github.com/stretchr/testify/mock"
    20  	"go.opentelemetry.io/collector/pdata/plog"
    21  	"go.opentelemetry.io/collector/pdata/pmetric"
    22  	"go.opentelemetry.io/collector/pdata/ptrace"
    23  )
    24  
    25  // MockSnapshotter is an autogenerated mock type for the Snapshotter type
    26  type MockSnapshotter struct {
    27  	mock.Mock
    28  }
    29  
    30  // SaveLogs provides a mock function with given fields: componentID, ld
    31  func (_m *MockSnapshotter) SaveLogs(componentID string, ld plog.Logs) {
    32  	_m.Called(componentID, ld)
    33  }
    34  
    35  // SaveMetrics provides a mock function with given fields: componentID, md
    36  func (_m *MockSnapshotter) SaveMetrics(componentID string, md pmetric.Metrics) {
    37  	_m.Called(componentID, md)
    38  }
    39  
    40  // SaveTraces provides a mock function with given fields: componentID, td
    41  func (_m *MockSnapshotter) SaveTraces(componentID string, td ptrace.Traces) {
    42  	_m.Called(componentID, td)
    43  }
    44  
    45  // NewMockSnapshotterT mock testing interface
    46  type NewMockSnapshotterT interface {
    47  	mock.TestingT
    48  	Cleanup(func())
    49  }
    50  
    51  // NewMockSnapshotter creates a new instance of MockSnapshotter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
    52  func NewMockSnapshotter(t NewMockSnapshotterT) *MockSnapshotter {
    53  	mock := &MockSnapshotter{}
    54  	mock.Mock.Test(t)
    55  
    56  	t.Cleanup(func() { mock.AssertExpectations(t) })
    57  
    58  	return mock
    59  }