github.com/devseccon/trivy@v0.47.1-0.20231123133102-bd902a0bd996/pkg/scanner/local/mock_applier.go (about)

     1  // Code generated by mockery v1.0.0. DO NOT EDIT.
     2  
     3  package local
     4  
     5  import (
     6  	mock "github.com/stretchr/testify/mock"
     7  
     8  	types "github.com/devseccon/trivy/pkg/fanal/types"
     9  )
    10  
    11  // MockApplier is an autogenerated mock type for the Applier type
    12  type MockApplier struct {
    13  	mock.Mock
    14  }
    15  
    16  type ApplierApplyLayersArgs struct {
    17  	ArtifactID         string
    18  	ArtifactIDAnything bool
    19  	BlobIDs            []string
    20  	BlobIDsAnything    bool
    21  }
    22  
    23  type ApplierApplyLayersReturns struct {
    24  	Detail types.ArtifactDetail
    25  	Err    error
    26  }
    27  
    28  type ApplierApplyLayersExpectation struct {
    29  	Args    ApplierApplyLayersArgs
    30  	Returns ApplierApplyLayersReturns
    31  }
    32  
    33  func (_m *MockApplier) ApplyApplyLayersExpectation(e ApplierApplyLayersExpectation) {
    34  	var args []interface{}
    35  	if e.Args.ArtifactIDAnything {
    36  		args = append(args, mock.Anything)
    37  	} else {
    38  		args = append(args, e.Args.ArtifactID)
    39  	}
    40  	if e.Args.BlobIDsAnything {
    41  		args = append(args, mock.Anything)
    42  	} else {
    43  		args = append(args, e.Args.BlobIDs)
    44  	}
    45  	_m.On("ApplyLayers", args...).Return(e.Returns.Detail, e.Returns.Err)
    46  }
    47  
    48  func (_m *MockApplier) ApplyApplyLayersExpectations(expectations []ApplierApplyLayersExpectation) {
    49  	for _, e := range expectations {
    50  		_m.ApplyApplyLayersExpectation(e)
    51  	}
    52  }
    53  
    54  // ApplyLayers provides a mock function with given fields: artifactID, blobIDs
    55  func (_m *MockApplier) ApplyLayers(artifactID string, blobIDs []string) (types.ArtifactDetail, error) {
    56  	ret := _m.Called(artifactID, blobIDs)
    57  
    58  	var r0 types.ArtifactDetail
    59  	if rf, ok := ret.Get(0).(func(string, []string) types.ArtifactDetail); ok {
    60  		r0 = rf(artifactID, blobIDs)
    61  	} else {
    62  		r0 = ret.Get(0).(types.ArtifactDetail)
    63  	}
    64  
    65  	var r1 error
    66  	if rf, ok := ret.Get(1).(func(string, []string) error); ok {
    67  		r1 = rf(artifactID, blobIDs)
    68  	} else {
    69  		r1 = ret.Error(1)
    70  	}
    71  
    72  	return r0, r1
    73  }