github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/command/v6/v6fakes/fake_manifest_parser.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package v6fakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	v6 "code.cloudfoundry.org/cli/command/v6"
     8  	"github.com/cloudfoundry/bosh-cli/director/template"
     9  )
    10  
    11  type FakeManifestParser struct {
    12  	AppNamesStub        func() []string
    13  	appNamesMutex       sync.RWMutex
    14  	appNamesArgsForCall []struct {
    15  	}
    16  	appNamesReturns struct {
    17  		result1 []string
    18  	}
    19  	appNamesReturnsOnCall map[int]struct {
    20  		result1 []string
    21  	}
    22  	InterpolateAndParseStub        func(string, []string, []template.VarKV, string) error
    23  	interpolateAndParseMutex       sync.RWMutex
    24  	interpolateAndParseArgsForCall []struct {
    25  		arg1 string
    26  		arg2 []string
    27  		arg3 []template.VarKV
    28  		arg4 string
    29  	}
    30  	interpolateAndParseReturns struct {
    31  		result1 error
    32  	}
    33  	interpolateAndParseReturnsOnCall map[int]struct {
    34  		result1 error
    35  	}
    36  	RawAppManifestStub        func(string) ([]byte, error)
    37  	rawAppManifestMutex       sync.RWMutex
    38  	rawAppManifestArgsForCall []struct {
    39  		arg1 string
    40  	}
    41  	rawAppManifestReturns struct {
    42  		result1 []byte
    43  		result2 error
    44  	}
    45  	rawAppManifestReturnsOnCall map[int]struct {
    46  		result1 []byte
    47  		result2 error
    48  	}
    49  	invocations      map[string][][]interface{}
    50  	invocationsMutex sync.RWMutex
    51  }
    52  
    53  func (fake *FakeManifestParser) AppNames() []string {
    54  	fake.appNamesMutex.Lock()
    55  	ret, specificReturn := fake.appNamesReturnsOnCall[len(fake.appNamesArgsForCall)]
    56  	fake.appNamesArgsForCall = append(fake.appNamesArgsForCall, struct {
    57  	}{})
    58  	fake.recordInvocation("AppNames", []interface{}{})
    59  	fake.appNamesMutex.Unlock()
    60  	if fake.AppNamesStub != nil {
    61  		return fake.AppNamesStub()
    62  	}
    63  	if specificReturn {
    64  		return ret.result1
    65  	}
    66  	fakeReturns := fake.appNamesReturns
    67  	return fakeReturns.result1
    68  }
    69  
    70  func (fake *FakeManifestParser) AppNamesCallCount() int {
    71  	fake.appNamesMutex.RLock()
    72  	defer fake.appNamesMutex.RUnlock()
    73  	return len(fake.appNamesArgsForCall)
    74  }
    75  
    76  func (fake *FakeManifestParser) AppNamesCalls(stub func() []string) {
    77  	fake.appNamesMutex.Lock()
    78  	defer fake.appNamesMutex.Unlock()
    79  	fake.AppNamesStub = stub
    80  }
    81  
    82  func (fake *FakeManifestParser) AppNamesReturns(result1 []string) {
    83  	fake.appNamesMutex.Lock()
    84  	defer fake.appNamesMutex.Unlock()
    85  	fake.AppNamesStub = nil
    86  	fake.appNamesReturns = struct {
    87  		result1 []string
    88  	}{result1}
    89  }
    90  
    91  func (fake *FakeManifestParser) AppNamesReturnsOnCall(i int, result1 []string) {
    92  	fake.appNamesMutex.Lock()
    93  	defer fake.appNamesMutex.Unlock()
    94  	fake.AppNamesStub = nil
    95  	if fake.appNamesReturnsOnCall == nil {
    96  		fake.appNamesReturnsOnCall = make(map[int]struct {
    97  			result1 []string
    98  		})
    99  	}
   100  	fake.appNamesReturnsOnCall[i] = struct {
   101  		result1 []string
   102  	}{result1}
   103  }
   104  
   105  func (fake *FakeManifestParser) InterpolateAndParse(arg1 string, arg2 []string, arg3 []template.VarKV, arg4 string) error {
   106  	var arg2Copy []string
   107  	if arg2 != nil {
   108  		arg2Copy = make([]string, len(arg2))
   109  		copy(arg2Copy, arg2)
   110  	}
   111  	var arg3Copy []template.VarKV
   112  	if arg3 != nil {
   113  		arg3Copy = make([]template.VarKV, len(arg3))
   114  		copy(arg3Copy, arg3)
   115  	}
   116  	fake.interpolateAndParseMutex.Lock()
   117  	ret, specificReturn := fake.interpolateAndParseReturnsOnCall[len(fake.interpolateAndParseArgsForCall)]
   118  	fake.interpolateAndParseArgsForCall = append(fake.interpolateAndParseArgsForCall, struct {
   119  		arg1 string
   120  		arg2 []string
   121  		arg3 []template.VarKV
   122  		arg4 string
   123  	}{arg1, arg2Copy, arg3Copy, arg4})
   124  	fake.recordInvocation("InterpolateAndParse", []interface{}{arg1, arg2Copy, arg3Copy, arg4})
   125  	fake.interpolateAndParseMutex.Unlock()
   126  	if fake.InterpolateAndParseStub != nil {
   127  		return fake.InterpolateAndParseStub(arg1, arg2, arg3, arg4)
   128  	}
   129  	if specificReturn {
   130  		return ret.result1
   131  	}
   132  	fakeReturns := fake.interpolateAndParseReturns
   133  	return fakeReturns.result1
   134  }
   135  
   136  func (fake *FakeManifestParser) InterpolateAndParseCallCount() int {
   137  	fake.interpolateAndParseMutex.RLock()
   138  	defer fake.interpolateAndParseMutex.RUnlock()
   139  	return len(fake.interpolateAndParseArgsForCall)
   140  }
   141  
   142  func (fake *FakeManifestParser) InterpolateAndParseCalls(stub func(string, []string, []template.VarKV, string) error) {
   143  	fake.interpolateAndParseMutex.Lock()
   144  	defer fake.interpolateAndParseMutex.Unlock()
   145  	fake.InterpolateAndParseStub = stub
   146  }
   147  
   148  func (fake *FakeManifestParser) InterpolateAndParseArgsForCall(i int) (string, []string, []template.VarKV, string) {
   149  	fake.interpolateAndParseMutex.RLock()
   150  	defer fake.interpolateAndParseMutex.RUnlock()
   151  	argsForCall := fake.interpolateAndParseArgsForCall[i]
   152  	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4
   153  }
   154  
   155  func (fake *FakeManifestParser) InterpolateAndParseReturns(result1 error) {
   156  	fake.interpolateAndParseMutex.Lock()
   157  	defer fake.interpolateAndParseMutex.Unlock()
   158  	fake.InterpolateAndParseStub = nil
   159  	fake.interpolateAndParseReturns = struct {
   160  		result1 error
   161  	}{result1}
   162  }
   163  
   164  func (fake *FakeManifestParser) InterpolateAndParseReturnsOnCall(i int, result1 error) {
   165  	fake.interpolateAndParseMutex.Lock()
   166  	defer fake.interpolateAndParseMutex.Unlock()
   167  	fake.InterpolateAndParseStub = nil
   168  	if fake.interpolateAndParseReturnsOnCall == nil {
   169  		fake.interpolateAndParseReturnsOnCall = make(map[int]struct {
   170  			result1 error
   171  		})
   172  	}
   173  	fake.interpolateAndParseReturnsOnCall[i] = struct {
   174  		result1 error
   175  	}{result1}
   176  }
   177  
   178  func (fake *FakeManifestParser) RawAppManifest(arg1 string) ([]byte, error) {
   179  	fake.rawAppManifestMutex.Lock()
   180  	ret, specificReturn := fake.rawAppManifestReturnsOnCall[len(fake.rawAppManifestArgsForCall)]
   181  	fake.rawAppManifestArgsForCall = append(fake.rawAppManifestArgsForCall, struct {
   182  		arg1 string
   183  	}{arg1})
   184  	fake.recordInvocation("RawAppManifest", []interface{}{arg1})
   185  	fake.rawAppManifestMutex.Unlock()
   186  	if fake.RawAppManifestStub != nil {
   187  		return fake.RawAppManifestStub(arg1)
   188  	}
   189  	if specificReturn {
   190  		return ret.result1, ret.result2
   191  	}
   192  	fakeReturns := fake.rawAppManifestReturns
   193  	return fakeReturns.result1, fakeReturns.result2
   194  }
   195  
   196  func (fake *FakeManifestParser) RawAppManifestCallCount() int {
   197  	fake.rawAppManifestMutex.RLock()
   198  	defer fake.rawAppManifestMutex.RUnlock()
   199  	return len(fake.rawAppManifestArgsForCall)
   200  }
   201  
   202  func (fake *FakeManifestParser) RawAppManifestCalls(stub func(string) ([]byte, error)) {
   203  	fake.rawAppManifestMutex.Lock()
   204  	defer fake.rawAppManifestMutex.Unlock()
   205  	fake.RawAppManifestStub = stub
   206  }
   207  
   208  func (fake *FakeManifestParser) RawAppManifestArgsForCall(i int) string {
   209  	fake.rawAppManifestMutex.RLock()
   210  	defer fake.rawAppManifestMutex.RUnlock()
   211  	argsForCall := fake.rawAppManifestArgsForCall[i]
   212  	return argsForCall.arg1
   213  }
   214  
   215  func (fake *FakeManifestParser) RawAppManifestReturns(result1 []byte, result2 error) {
   216  	fake.rawAppManifestMutex.Lock()
   217  	defer fake.rawAppManifestMutex.Unlock()
   218  	fake.RawAppManifestStub = nil
   219  	fake.rawAppManifestReturns = struct {
   220  		result1 []byte
   221  		result2 error
   222  	}{result1, result2}
   223  }
   224  
   225  func (fake *FakeManifestParser) RawAppManifestReturnsOnCall(i int, result1 []byte, result2 error) {
   226  	fake.rawAppManifestMutex.Lock()
   227  	defer fake.rawAppManifestMutex.Unlock()
   228  	fake.RawAppManifestStub = nil
   229  	if fake.rawAppManifestReturnsOnCall == nil {
   230  		fake.rawAppManifestReturnsOnCall = make(map[int]struct {
   231  			result1 []byte
   232  			result2 error
   233  		})
   234  	}
   235  	fake.rawAppManifestReturnsOnCall[i] = struct {
   236  		result1 []byte
   237  		result2 error
   238  	}{result1, result2}
   239  }
   240  
   241  func (fake *FakeManifestParser) Invocations() map[string][][]interface{} {
   242  	fake.invocationsMutex.RLock()
   243  	defer fake.invocationsMutex.RUnlock()
   244  	fake.appNamesMutex.RLock()
   245  	defer fake.appNamesMutex.RUnlock()
   246  	fake.interpolateAndParseMutex.RLock()
   247  	defer fake.interpolateAndParseMutex.RUnlock()
   248  	fake.rawAppManifestMutex.RLock()
   249  	defer fake.rawAppManifestMutex.RUnlock()
   250  	copiedInvocations := map[string][][]interface{}{}
   251  	for key, value := range fake.invocations {
   252  		copiedInvocations[key] = value
   253  	}
   254  	return copiedInvocations
   255  }
   256  
   257  func (fake *FakeManifestParser) recordInvocation(key string, args []interface{}) {
   258  	fake.invocationsMutex.Lock()
   259  	defer fake.invocationsMutex.Unlock()
   260  	if fake.invocations == nil {
   261  		fake.invocations = map[string][][]interface{}{}
   262  	}
   263  	if fake.invocations[key] == nil {
   264  		fake.invocations[key] = [][]interface{}{}
   265  	}
   266  	fake.invocations[key] = append(fake.invocations[key], args)
   267  }
   268  
   269  var _ v6.ManifestParser = new(FakeManifestParser)