2023-03-11 01:16:11 +01:00
// Code generated by mockery v2.22.1. 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
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 ( )
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 ( )
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 ( )
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 ( )
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 ( )
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
2022-08-22 08:21:13 +02:00
type mockConstructorTestingTNewContext interface {
2022-06-07 10:04:33 +02:00
mock . TestingT
Cleanup ( func ( ) )
}
// 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.
2022-08-22 08:21:13 +02:00
func NewContext ( t mockConstructorTestingTNewContext ) * Context {
2022-06-07 10:04:33 +02:00
mock := & Context { }
mock . Mock . Test ( t )
t . Cleanup ( func ( ) { mock . AssertExpectations ( t ) } )
return mock
}