github.com/niteshexa/cloudfoundry_cli@v7.1.0+incompatible/command/v7/v7fakes/fake_manifest_parser.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package v7fakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	v7 "code.cloudfoundry.org/cli/command/v7"
     8  	"code.cloudfoundry.org/cli/util/manifestparser"
     9  	"github.com/cloudfoundry/bosh-cli/director/template"
    10  )
    11  
    12  type FakeManifestParser struct {
    13  	InterpolateAndParseStub        func(string, []string, []template.VarKV) (manifestparser.Manifest, error)
    14  	interpolateAndParseMutex       sync.RWMutex
    15  	interpolateAndParseArgsForCall []struct {
    16  		arg1 string
    17  		arg2 []string
    18  		arg3 []template.VarKV
    19  	}
    20  	interpolateAndParseReturns struct {
    21  		result1 manifestparser.Manifest
    22  		result2 error
    23  	}
    24  	interpolateAndParseReturnsOnCall map[int]struct {
    25  		result1 manifestparser.Manifest
    26  		result2 error
    27  	}
    28  	MarshalManifestStub        func(manifestparser.Manifest) ([]byte, error)
    29  	marshalManifestMutex       sync.RWMutex
    30  	marshalManifestArgsForCall []struct {
    31  		arg1 manifestparser.Manifest
    32  	}
    33  	marshalManifestReturns struct {
    34  		result1 []byte
    35  		result2 error
    36  	}
    37  	marshalManifestReturnsOnCall map[int]struct {
    38  		result1 []byte
    39  		result2 error
    40  	}
    41  	invocations      map[string][][]interface{}
    42  	invocationsMutex sync.RWMutex
    43  }
    44  
    45  func (fake *FakeManifestParser) InterpolateAndParse(arg1 string, arg2 []string, arg3 []template.VarKV) (manifestparser.Manifest, error) {
    46  	var arg2Copy []string
    47  	if arg2 != nil {
    48  		arg2Copy = make([]string, len(arg2))
    49  		copy(arg2Copy, arg2)
    50  	}
    51  	var arg3Copy []template.VarKV
    52  	if arg3 != nil {
    53  		arg3Copy = make([]template.VarKV, len(arg3))
    54  		copy(arg3Copy, arg3)
    55  	}
    56  	fake.interpolateAndParseMutex.Lock()
    57  	ret, specificReturn := fake.interpolateAndParseReturnsOnCall[len(fake.interpolateAndParseArgsForCall)]
    58  	fake.interpolateAndParseArgsForCall = append(fake.interpolateAndParseArgsForCall, struct {
    59  		arg1 string
    60  		arg2 []string
    61  		arg3 []template.VarKV
    62  	}{arg1, arg2Copy, arg3Copy})
    63  	fake.recordInvocation("InterpolateAndParse", []interface{}{arg1, arg2Copy, arg3Copy})
    64  	fake.interpolateAndParseMutex.Unlock()
    65  	if fake.InterpolateAndParseStub != nil {
    66  		return fake.InterpolateAndParseStub(arg1, arg2, arg3)
    67  	}
    68  	if specificReturn {
    69  		return ret.result1, ret.result2
    70  	}
    71  	fakeReturns := fake.interpolateAndParseReturns
    72  	return fakeReturns.result1, fakeReturns.result2
    73  }
    74  
    75  func (fake *FakeManifestParser) InterpolateAndParseCallCount() int {
    76  	fake.interpolateAndParseMutex.RLock()
    77  	defer fake.interpolateAndParseMutex.RUnlock()
    78  	return len(fake.interpolateAndParseArgsForCall)
    79  }
    80  
    81  func (fake *FakeManifestParser) InterpolateAndParseCalls(stub func(string, []string, []template.VarKV) (manifestparser.Manifest, error)) {
    82  	fake.interpolateAndParseMutex.Lock()
    83  	defer fake.interpolateAndParseMutex.Unlock()
    84  	fake.InterpolateAndParseStub = stub
    85  }
    86  
    87  func (fake *FakeManifestParser) InterpolateAndParseArgsForCall(i int) (string, []string, []template.VarKV) {
    88  	fake.interpolateAndParseMutex.RLock()
    89  	defer fake.interpolateAndParseMutex.RUnlock()
    90  	argsForCall := fake.interpolateAndParseArgsForCall[i]
    91  	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
    92  }
    93  
    94  func (fake *FakeManifestParser) InterpolateAndParseReturns(result1 manifestparser.Manifest, result2 error) {
    95  	fake.interpolateAndParseMutex.Lock()
    96  	defer fake.interpolateAndParseMutex.Unlock()
    97  	fake.InterpolateAndParseStub = nil
    98  	fake.interpolateAndParseReturns = struct {
    99  		result1 manifestparser.Manifest
   100  		result2 error
   101  	}{result1, result2}
   102  }
   103  
   104  func (fake *FakeManifestParser) InterpolateAndParseReturnsOnCall(i int, result1 manifestparser.Manifest, result2 error) {
   105  	fake.interpolateAndParseMutex.Lock()
   106  	defer fake.interpolateAndParseMutex.Unlock()
   107  	fake.InterpolateAndParseStub = nil
   108  	if fake.interpolateAndParseReturnsOnCall == nil {
   109  		fake.interpolateAndParseReturnsOnCall = make(map[int]struct {
   110  			result1 manifestparser.Manifest
   111  			result2 error
   112  		})
   113  	}
   114  	fake.interpolateAndParseReturnsOnCall[i] = struct {
   115  		result1 manifestparser.Manifest
   116  		result2 error
   117  	}{result1, result2}
   118  }
   119  
   120  func (fake *FakeManifestParser) MarshalManifest(arg1 manifestparser.Manifest) ([]byte, error) {
   121  	fake.marshalManifestMutex.Lock()
   122  	ret, specificReturn := fake.marshalManifestReturnsOnCall[len(fake.marshalManifestArgsForCall)]
   123  	fake.marshalManifestArgsForCall = append(fake.marshalManifestArgsForCall, struct {
   124  		arg1 manifestparser.Manifest
   125  	}{arg1})
   126  	fake.recordInvocation("MarshalManifest", []interface{}{arg1})
   127  	fake.marshalManifestMutex.Unlock()
   128  	if fake.MarshalManifestStub != nil {
   129  		return fake.MarshalManifestStub(arg1)
   130  	}
   131  	if specificReturn {
   132  		return ret.result1, ret.result2
   133  	}
   134  	fakeReturns := fake.marshalManifestReturns
   135  	return fakeReturns.result1, fakeReturns.result2
   136  }
   137  
   138  func (fake *FakeManifestParser) MarshalManifestCallCount() int {
   139  	fake.marshalManifestMutex.RLock()
   140  	defer fake.marshalManifestMutex.RUnlock()
   141  	return len(fake.marshalManifestArgsForCall)
   142  }
   143  
   144  func (fake *FakeManifestParser) MarshalManifestCalls(stub func(manifestparser.Manifest) ([]byte, error)) {
   145  	fake.marshalManifestMutex.Lock()
   146  	defer fake.marshalManifestMutex.Unlock()
   147  	fake.MarshalManifestStub = stub
   148  }
   149  
   150  func (fake *FakeManifestParser) MarshalManifestArgsForCall(i int) manifestparser.Manifest {
   151  	fake.marshalManifestMutex.RLock()
   152  	defer fake.marshalManifestMutex.RUnlock()
   153  	argsForCall := fake.marshalManifestArgsForCall[i]
   154  	return argsForCall.arg1
   155  }
   156  
   157  func (fake *FakeManifestParser) MarshalManifestReturns(result1 []byte, result2 error) {
   158  	fake.marshalManifestMutex.Lock()
   159  	defer fake.marshalManifestMutex.Unlock()
   160  	fake.MarshalManifestStub = nil
   161  	fake.marshalManifestReturns = struct {
   162  		result1 []byte
   163  		result2 error
   164  	}{result1, result2}
   165  }
   166  
   167  func (fake *FakeManifestParser) MarshalManifestReturnsOnCall(i int, result1 []byte, result2 error) {
   168  	fake.marshalManifestMutex.Lock()
   169  	defer fake.marshalManifestMutex.Unlock()
   170  	fake.MarshalManifestStub = nil
   171  	if fake.marshalManifestReturnsOnCall == nil {
   172  		fake.marshalManifestReturnsOnCall = make(map[int]struct {
   173  			result1 []byte
   174  			result2 error
   175  		})
   176  	}
   177  	fake.marshalManifestReturnsOnCall[i] = struct {
   178  		result1 []byte
   179  		result2 error
   180  	}{result1, result2}
   181  }
   182  
   183  func (fake *FakeManifestParser) Invocations() map[string][][]interface{} {
   184  	fake.invocationsMutex.RLock()
   185  	defer fake.invocationsMutex.RUnlock()
   186  	fake.interpolateAndParseMutex.RLock()
   187  	defer fake.interpolateAndParseMutex.RUnlock()
   188  	fake.marshalManifestMutex.RLock()
   189  	defer fake.marshalManifestMutex.RUnlock()
   190  	copiedInvocations := map[string][][]interface{}{}
   191  	for key, value := range fake.invocations {
   192  		copiedInvocations[key] = value
   193  	}
   194  	return copiedInvocations
   195  }
   196  
   197  func (fake *FakeManifestParser) recordInvocation(key string, args []interface{}) {
   198  	fake.invocationsMutex.Lock()
   199  	defer fake.invocationsMutex.Unlock()
   200  	if fake.invocations == nil {
   201  		fake.invocations = map[string][][]interface{}{}
   202  	}
   203  	if fake.invocations[key] == nil {
   204  		fake.invocations[key] = [][]interface{}{}
   205  	}
   206  	fake.invocations[key] = append(fake.invocations[key], args)
   207  }
   208  
   209  var _ v7.ManifestParser = new(FakeManifestParser)