github.com/wanddynosios/cli/v8@v8.7.9-0.20240221182337-1a92e3a7017f/actor/v7action/v7actionfakes/fake_routing_client.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package v7actionfakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"code.cloudfoundry.org/cli/actor/v7action"
     8  	"code.cloudfoundry.org/cli/api/router"
     9  )
    10  
    11  type FakeRoutingClient struct {
    12  	GetRouterGroupByNameStub        func(string) (router.RouterGroup, error)
    13  	getRouterGroupByNameMutex       sync.RWMutex
    14  	getRouterGroupByNameArgsForCall []struct {
    15  		arg1 string
    16  	}
    17  	getRouterGroupByNameReturns struct {
    18  		result1 router.RouterGroup
    19  		result2 error
    20  	}
    21  	getRouterGroupByNameReturnsOnCall map[int]struct {
    22  		result1 router.RouterGroup
    23  		result2 error
    24  	}
    25  	GetRouterGroupsStub        func() ([]router.RouterGroup, error)
    26  	getRouterGroupsMutex       sync.RWMutex
    27  	getRouterGroupsArgsForCall []struct {
    28  	}
    29  	getRouterGroupsReturns struct {
    30  		result1 []router.RouterGroup
    31  		result2 error
    32  	}
    33  	getRouterGroupsReturnsOnCall map[int]struct {
    34  		result1 []router.RouterGroup
    35  		result2 error
    36  	}
    37  	invocations      map[string][][]interface{}
    38  	invocationsMutex sync.RWMutex
    39  }
    40  
    41  func (fake *FakeRoutingClient) GetRouterGroupByName(arg1 string) (router.RouterGroup, error) {
    42  	fake.getRouterGroupByNameMutex.Lock()
    43  	ret, specificReturn := fake.getRouterGroupByNameReturnsOnCall[len(fake.getRouterGroupByNameArgsForCall)]
    44  	fake.getRouterGroupByNameArgsForCall = append(fake.getRouterGroupByNameArgsForCall, struct {
    45  		arg1 string
    46  	}{arg1})
    47  	fake.recordInvocation("GetRouterGroupByName", []interface{}{arg1})
    48  	fake.getRouterGroupByNameMutex.Unlock()
    49  	if fake.GetRouterGroupByNameStub != nil {
    50  		return fake.GetRouterGroupByNameStub(arg1)
    51  	}
    52  	if specificReturn {
    53  		return ret.result1, ret.result2
    54  	}
    55  	fakeReturns := fake.getRouterGroupByNameReturns
    56  	return fakeReturns.result1, fakeReturns.result2
    57  }
    58  
    59  func (fake *FakeRoutingClient) GetRouterGroupByNameCallCount() int {
    60  	fake.getRouterGroupByNameMutex.RLock()
    61  	defer fake.getRouterGroupByNameMutex.RUnlock()
    62  	return len(fake.getRouterGroupByNameArgsForCall)
    63  }
    64  
    65  func (fake *FakeRoutingClient) GetRouterGroupByNameCalls(stub func(string) (router.RouterGroup, error)) {
    66  	fake.getRouterGroupByNameMutex.Lock()
    67  	defer fake.getRouterGroupByNameMutex.Unlock()
    68  	fake.GetRouterGroupByNameStub = stub
    69  }
    70  
    71  func (fake *FakeRoutingClient) GetRouterGroupByNameArgsForCall(i int) string {
    72  	fake.getRouterGroupByNameMutex.RLock()
    73  	defer fake.getRouterGroupByNameMutex.RUnlock()
    74  	argsForCall := fake.getRouterGroupByNameArgsForCall[i]
    75  	return argsForCall.arg1
    76  }
    77  
    78  func (fake *FakeRoutingClient) GetRouterGroupByNameReturns(result1 router.RouterGroup, result2 error) {
    79  	fake.getRouterGroupByNameMutex.Lock()
    80  	defer fake.getRouterGroupByNameMutex.Unlock()
    81  	fake.GetRouterGroupByNameStub = nil
    82  	fake.getRouterGroupByNameReturns = struct {
    83  		result1 router.RouterGroup
    84  		result2 error
    85  	}{result1, result2}
    86  }
    87  
    88  func (fake *FakeRoutingClient) GetRouterGroupByNameReturnsOnCall(i int, result1 router.RouterGroup, result2 error) {
    89  	fake.getRouterGroupByNameMutex.Lock()
    90  	defer fake.getRouterGroupByNameMutex.Unlock()
    91  	fake.GetRouterGroupByNameStub = nil
    92  	if fake.getRouterGroupByNameReturnsOnCall == nil {
    93  		fake.getRouterGroupByNameReturnsOnCall = make(map[int]struct {
    94  			result1 router.RouterGroup
    95  			result2 error
    96  		})
    97  	}
    98  	fake.getRouterGroupByNameReturnsOnCall[i] = struct {
    99  		result1 router.RouterGroup
   100  		result2 error
   101  	}{result1, result2}
   102  }
   103  
   104  func (fake *FakeRoutingClient) GetRouterGroups() ([]router.RouterGroup, error) {
   105  	fake.getRouterGroupsMutex.Lock()
   106  	ret, specificReturn := fake.getRouterGroupsReturnsOnCall[len(fake.getRouterGroupsArgsForCall)]
   107  	fake.getRouterGroupsArgsForCall = append(fake.getRouterGroupsArgsForCall, struct {
   108  	}{})
   109  	fake.recordInvocation("GetRouterGroups", []interface{}{})
   110  	fake.getRouterGroupsMutex.Unlock()
   111  	if fake.GetRouterGroupsStub != nil {
   112  		return fake.GetRouterGroupsStub()
   113  	}
   114  	if specificReturn {
   115  		return ret.result1, ret.result2
   116  	}
   117  	fakeReturns := fake.getRouterGroupsReturns
   118  	return fakeReturns.result1, fakeReturns.result2
   119  }
   120  
   121  func (fake *FakeRoutingClient) GetRouterGroupsCallCount() int {
   122  	fake.getRouterGroupsMutex.RLock()
   123  	defer fake.getRouterGroupsMutex.RUnlock()
   124  	return len(fake.getRouterGroupsArgsForCall)
   125  }
   126  
   127  func (fake *FakeRoutingClient) GetRouterGroupsCalls(stub func() ([]router.RouterGroup, error)) {
   128  	fake.getRouterGroupsMutex.Lock()
   129  	defer fake.getRouterGroupsMutex.Unlock()
   130  	fake.GetRouterGroupsStub = stub
   131  }
   132  
   133  func (fake *FakeRoutingClient) GetRouterGroupsReturns(result1 []router.RouterGroup, result2 error) {
   134  	fake.getRouterGroupsMutex.Lock()
   135  	defer fake.getRouterGroupsMutex.Unlock()
   136  	fake.GetRouterGroupsStub = nil
   137  	fake.getRouterGroupsReturns = struct {
   138  		result1 []router.RouterGroup
   139  		result2 error
   140  	}{result1, result2}
   141  }
   142  
   143  func (fake *FakeRoutingClient) GetRouterGroupsReturnsOnCall(i int, result1 []router.RouterGroup, result2 error) {
   144  	fake.getRouterGroupsMutex.Lock()
   145  	defer fake.getRouterGroupsMutex.Unlock()
   146  	fake.GetRouterGroupsStub = nil
   147  	if fake.getRouterGroupsReturnsOnCall == nil {
   148  		fake.getRouterGroupsReturnsOnCall = make(map[int]struct {
   149  			result1 []router.RouterGroup
   150  			result2 error
   151  		})
   152  	}
   153  	fake.getRouterGroupsReturnsOnCall[i] = struct {
   154  		result1 []router.RouterGroup
   155  		result2 error
   156  	}{result1, result2}
   157  }
   158  
   159  func (fake *FakeRoutingClient) Invocations() map[string][][]interface{} {
   160  	fake.invocationsMutex.RLock()
   161  	defer fake.invocationsMutex.RUnlock()
   162  	fake.getRouterGroupByNameMutex.RLock()
   163  	defer fake.getRouterGroupByNameMutex.RUnlock()
   164  	fake.getRouterGroupsMutex.RLock()
   165  	defer fake.getRouterGroupsMutex.RUnlock()
   166  	copiedInvocations := map[string][][]interface{}{}
   167  	for key, value := range fake.invocations {
   168  		copiedInvocations[key] = value
   169  	}
   170  	return copiedInvocations
   171  }
   172  
   173  func (fake *FakeRoutingClient) recordInvocation(key string, args []interface{}) {
   174  	fake.invocationsMutex.Lock()
   175  	defer fake.invocationsMutex.Unlock()
   176  	if fake.invocations == nil {
   177  		fake.invocations = map[string][][]interface{}{}
   178  	}
   179  	if fake.invocations[key] == nil {
   180  		fake.invocations[key] = [][]interface{}{}
   181  	}
   182  	fake.invocations[key] = append(fake.invocations[key], args)
   183  }
   184  
   185  var _ v7action.RoutingClient = new(FakeRoutingClient)