2024-04-11 05:37:59 +02:00
// Code generated by mockery v2.42.2. DO NOT EDIT.
2020-03-12 16:42:53 +01:00
package security
import (
2020-10-19 12:33:51 +02:00
context "context"
2020-03-12 16:42:53 +01:00
mock "github.com/stretchr/testify/mock"
types "github.com/goharbor/harbor/src/pkg/permission/types"
)
// Context is an autogenerated mock type for the Context type
type Context struct {
mock . Mock
}
2020-10-19 12:33:51 +02:00
// Can provides a mock function with given fields: ctx, action, resource
func ( _m * Context ) Can ( ctx context . Context , action types . Action , resource types . Resource ) bool {
ret := _m . Called ( ctx , action , resource )
2020-03-12 16:42:53 +01:00
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for Can" )
}
2020-03-12 16:42:53 +01:00
var r0 bool
2020-10-19 12:33:51 +02:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , types . Action , types . Resource ) bool ) ; ok {
r0 = rf ( ctx , action , resource )
2020-03-12 16:42:53 +01:00
} else {
r0 = ret . Get ( 0 ) . ( bool )
}
return r0
}
// GetUsername provides a mock function with given fields:
func ( _m * Context ) GetUsername ( ) string {
ret := _m . Called ( )
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for GetUsername" )
}
2020-03-12 16:42:53 +01:00
var r0 string
if rf , ok := ret . Get ( 0 ) . ( func ( ) string ) ; ok {
r0 = rf ( )
} else {
r0 = ret . Get ( 0 ) . ( string )
}
return r0
}
// IsAuthenticated provides a mock function with given fields:
func ( _m * Context ) IsAuthenticated ( ) bool {
ret := _m . Called ( )
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for IsAuthenticated" )
}
2020-03-12 16:42:53 +01:00
var r0 bool
if rf , ok := ret . Get ( 0 ) . ( func ( ) bool ) ; ok {
r0 = rf ( )
} else {
r0 = ret . Get ( 0 ) . ( bool )
}
return r0
}
// IsSolutionUser provides a mock function with given fields:
func ( _m * Context ) IsSolutionUser ( ) bool {
ret := _m . Called ( )
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for IsSolutionUser" )
}
2020-03-12 16:42:53 +01:00
var r0 bool
if rf , ok := ret . Get ( 0 ) . ( func ( ) bool ) ; ok {
r0 = rf ( )
} else {
r0 = ret . Get ( 0 ) . ( bool )
}
return r0
}
// IsSysAdmin provides a mock function with given fields:
func ( _m * Context ) IsSysAdmin ( ) bool {
ret := _m . Called ( )
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for IsSysAdmin" )
}
2020-03-12 16:42:53 +01:00
var r0 bool
if rf , ok := ret . Get ( 0 ) . ( func ( ) bool ) ; ok {
r0 = rf ( )
} else {
r0 = ret . Get ( 0 ) . ( bool )
}
return r0
}
// Name provides a mock function with given fields:
func ( _m * Context ) Name ( ) string {
ret := _m . Called ( )
2024-04-11 05:37:59 +02:00
if len ( ret ) == 0 {
panic ( "no return value specified for Name" )
}
2020-03-12 16:42:53 +01:00
var r0 string
if rf , ok := ret . Get ( 0 ) . ( func ( ) string ) ; ok {
r0 = rf ( )
} else {
r0 = ret . Get ( 0 ) . ( string )
}
return r0
}
2022-06-07 10:04:33 +02:00
2023-11-05 07:37:25 +01:00
// NewContext creates a new instance of Context. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewContext ( t interface {
2022-06-07 10:04:33 +02:00
mock . TestingT
Cleanup ( func ( ) )
2023-11-05 07:37:25 +01:00
} ) * Context {
2022-06-07 10:04:33 +02:00
mock := & Context { }
mock . Mock . Test ( t )
t . Cleanup ( func ( ) { mock . AssertExpectations ( t ) } )
return mock
}