github.com/lukasheimann/cloudfoundrycli@v7.1.0+incompatible/actor/v7action/v7actionfakes/fake_manifest_parser.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  )
     9  
    10  type FakeManifestParser struct {
    11  	AppNamesStub        func() []string
    12  	appNamesMutex       sync.RWMutex
    13  	appNamesArgsForCall []struct {
    14  	}
    15  	appNamesReturns struct {
    16  		result1 []string
    17  	}
    18  	appNamesReturnsOnCall map[int]struct {
    19  		result1 []string
    20  	}
    21  	RawAppManifestStub        func(string) ([]byte, error)
    22  	rawAppManifestMutex       sync.RWMutex
    23  	rawAppManifestArgsForCall []struct {
    24  		arg1 string
    25  	}
    26  	rawAppManifestReturns struct {
    27  		result1 []byte
    28  		result2 error
    29  	}
    30  	rawAppManifestReturnsOnCall map[int]struct {
    31  		result1 []byte
    32  		result2 error
    33  	}
    34  	invocations      map[string][][]interface{}
    35  	invocationsMutex sync.RWMutex
    36  }
    37  
    38  func (fake *FakeManifestParser) AppNames() []string {
    39  	fake.appNamesMutex.Lock()
    40  	ret, specificReturn := fake.appNamesReturnsOnCall[len(fake.appNamesArgsForCall)]
    41  	fake.appNamesArgsForCall = append(fake.appNamesArgsForCall, struct {
    42  	}{})
    43  	fake.recordInvocation("AppNames", []interface{}{})
    44  	fake.appNamesMutex.Unlock()
    45  	if fake.AppNamesStub != nil {
    46  		return fake.AppNamesStub()
    47  	}
    48  	if specificReturn {
    49  		return ret.result1
    50  	}
    51  	fakeReturns := fake.appNamesReturns
    52  	return fakeReturns.result1
    53  }
    54  
    55  func (fake *FakeManifestParser) AppNamesCallCount() int {
    56  	fake.appNamesMutex.RLock()
    57  	defer fake.appNamesMutex.RUnlock()
    58  	return len(fake.appNamesArgsForCall)
    59  }
    60  
    61  func (fake *FakeManifestParser) AppNamesCalls(stub func() []string) {
    62  	fake.appNamesMutex.Lock()
    63  	defer fake.appNamesMutex.Unlock()
    64  	fake.AppNamesStub = stub
    65  }
    66  
    67  func (fake *FakeManifestParser) AppNamesReturns(result1 []string) {
    68  	fake.appNamesMutex.Lock()
    69  	defer fake.appNamesMutex.Unlock()
    70  	fake.AppNamesStub = nil
    71  	fake.appNamesReturns = struct {
    72  		result1 []string
    73  	}{result1}
    74  }
    75  
    76  func (fake *FakeManifestParser) AppNamesReturnsOnCall(i int, result1 []string) {
    77  	fake.appNamesMutex.Lock()
    78  	defer fake.appNamesMutex.Unlock()
    79  	fake.AppNamesStub = nil
    80  	if fake.appNamesReturnsOnCall == nil {
    81  		fake.appNamesReturnsOnCall = make(map[int]struct {
    82  			result1 []string
    83  		})
    84  	}
    85  	fake.appNamesReturnsOnCall[i] = struct {
    86  		result1 []string
    87  	}{result1}
    88  }
    89  
    90  func (fake *FakeManifestParser) RawAppManifest(arg1 string) ([]byte, error) {
    91  	fake.rawAppManifestMutex.Lock()
    92  	ret, specificReturn := fake.rawAppManifestReturnsOnCall[len(fake.rawAppManifestArgsForCall)]
    93  	fake.rawAppManifestArgsForCall = append(fake.rawAppManifestArgsForCall, struct {
    94  		arg1 string
    95  	}{arg1})
    96  	fake.recordInvocation("RawAppManifest", []interface{}{arg1})
    97  	fake.rawAppManifestMutex.Unlock()
    98  	if fake.RawAppManifestStub != nil {
    99  		return fake.RawAppManifestStub(arg1)
   100  	}
   101  	if specificReturn {
   102  		return ret.result1, ret.result2
   103  	}
   104  	fakeReturns := fake.rawAppManifestReturns
   105  	return fakeReturns.result1, fakeReturns.result2
   106  }
   107  
   108  func (fake *FakeManifestParser) RawAppManifestCallCount() int {
   109  	fake.rawAppManifestMutex.RLock()
   110  	defer fake.rawAppManifestMutex.RUnlock()
   111  	return len(fake.rawAppManifestArgsForCall)
   112  }
   113  
   114  func (fake *FakeManifestParser) RawAppManifestCalls(stub func(string) ([]byte, error)) {
   115  	fake.rawAppManifestMutex.Lock()
   116  	defer fake.rawAppManifestMutex.Unlock()
   117  	fake.RawAppManifestStub = stub
   118  }
   119  
   120  func (fake *FakeManifestParser) RawAppManifestArgsForCall(i int) string {
   121  	fake.rawAppManifestMutex.RLock()
   122  	defer fake.rawAppManifestMutex.RUnlock()
   123  	argsForCall := fake.rawAppManifestArgsForCall[i]
   124  	return argsForCall.arg1
   125  }
   126  
   127  func (fake *FakeManifestParser) RawAppManifestReturns(result1 []byte, result2 error) {
   128  	fake.rawAppManifestMutex.Lock()
   129  	defer fake.rawAppManifestMutex.Unlock()
   130  	fake.RawAppManifestStub = nil
   131  	fake.rawAppManifestReturns = struct {
   132  		result1 []byte
   133  		result2 error
   134  	}{result1, result2}
   135  }
   136  
   137  func (fake *FakeManifestParser) RawAppManifestReturnsOnCall(i int, result1 []byte, result2 error) {
   138  	fake.rawAppManifestMutex.Lock()
   139  	defer fake.rawAppManifestMutex.Unlock()
   140  	fake.RawAppManifestStub = nil
   141  	if fake.rawAppManifestReturnsOnCall == nil {
   142  		fake.rawAppManifestReturnsOnCall = make(map[int]struct {
   143  			result1 []byte
   144  			result2 error
   145  		})
   146  	}
   147  	fake.rawAppManifestReturnsOnCall[i] = struct {
   148  		result1 []byte
   149  		result2 error
   150  	}{result1, result2}
   151  }
   152  
   153  func (fake *FakeManifestParser) Invocations() map[string][][]interface{} {
   154  	fake.invocationsMutex.RLock()
   155  	defer fake.invocationsMutex.RUnlock()
   156  	fake.appNamesMutex.RLock()
   157  	defer fake.appNamesMutex.RUnlock()
   158  	fake.rawAppManifestMutex.RLock()
   159  	defer fake.rawAppManifestMutex.RUnlock()
   160  	copiedInvocations := map[string][][]interface{}{}
   161  	for key, value := range fake.invocations {
   162  		copiedInvocations[key] = value
   163  	}
   164  	return copiedInvocations
   165  }
   166  
   167  func (fake *FakeManifestParser) recordInvocation(key string, args []interface{}) {
   168  	fake.invocationsMutex.Lock()
   169  	defer fake.invocationsMutex.Unlock()
   170  	if fake.invocations == nil {
   171  		fake.invocations = map[string][][]interface{}{}
   172  	}
   173  	if fake.invocations[key] == nil {
   174  		fake.invocations[key] = [][]interface{}{}
   175  	}
   176  	fake.invocations[key] = append(fake.invocations[key], args)
   177  }
   178  
   179  var _ v7action.ManifestParser = new(FakeManifestParser)