github.com/yacovm/fabric@v2.0.0-alpha.0.20191128145320-c5d4087dc723+incompatible/common/flogging/httpadmin/fakes/logging.go (about)

     1  // Code generated by counterfeiter. DO NOT EDIT.
     2  package fakes
     3  
     4  import (
     5  	"sync"
     6  
     7  	"github.com/hyperledger/fabric/common/flogging/httpadmin"
     8  )
     9  
    10  type Logging struct {
    11  	ActivateSpecStub        func(string) error
    12  	activateSpecMutex       sync.RWMutex
    13  	activateSpecArgsForCall []struct {
    14  		arg1 string
    15  	}
    16  	activateSpecReturns struct {
    17  		result1 error
    18  	}
    19  	activateSpecReturnsOnCall map[int]struct {
    20  		result1 error
    21  	}
    22  	SpecStub        func() string
    23  	specMutex       sync.RWMutex
    24  	specArgsForCall []struct {
    25  	}
    26  	specReturns struct {
    27  		result1 string
    28  	}
    29  	specReturnsOnCall map[int]struct {
    30  		result1 string
    31  	}
    32  	invocations      map[string][][]interface{}
    33  	invocationsMutex sync.RWMutex
    34  }
    35  
    36  func (fake *Logging) ActivateSpec(arg1 string) error {
    37  	fake.activateSpecMutex.Lock()
    38  	ret, specificReturn := fake.activateSpecReturnsOnCall[len(fake.activateSpecArgsForCall)]
    39  	fake.activateSpecArgsForCall = append(fake.activateSpecArgsForCall, struct {
    40  		arg1 string
    41  	}{arg1})
    42  	fake.recordInvocation("ActivateSpec", []interface{}{arg1})
    43  	fake.activateSpecMutex.Unlock()
    44  	if fake.ActivateSpecStub != nil {
    45  		return fake.ActivateSpecStub(arg1)
    46  	}
    47  	if specificReturn {
    48  		return ret.result1
    49  	}
    50  	fakeReturns := fake.activateSpecReturns
    51  	return fakeReturns.result1
    52  }
    53  
    54  func (fake *Logging) ActivateSpecCallCount() int {
    55  	fake.activateSpecMutex.RLock()
    56  	defer fake.activateSpecMutex.RUnlock()
    57  	return len(fake.activateSpecArgsForCall)
    58  }
    59  
    60  func (fake *Logging) ActivateSpecCalls(stub func(string) error) {
    61  	fake.activateSpecMutex.Lock()
    62  	defer fake.activateSpecMutex.Unlock()
    63  	fake.ActivateSpecStub = stub
    64  }
    65  
    66  func (fake *Logging) ActivateSpecArgsForCall(i int) string {
    67  	fake.activateSpecMutex.RLock()
    68  	defer fake.activateSpecMutex.RUnlock()
    69  	argsForCall := fake.activateSpecArgsForCall[i]
    70  	return argsForCall.arg1
    71  }
    72  
    73  func (fake *Logging) ActivateSpecReturns(result1 error) {
    74  	fake.activateSpecMutex.Lock()
    75  	defer fake.activateSpecMutex.Unlock()
    76  	fake.ActivateSpecStub = nil
    77  	fake.activateSpecReturns = struct {
    78  		result1 error
    79  	}{result1}
    80  }
    81  
    82  func (fake *Logging) ActivateSpecReturnsOnCall(i int, result1 error) {
    83  	fake.activateSpecMutex.Lock()
    84  	defer fake.activateSpecMutex.Unlock()
    85  	fake.ActivateSpecStub = nil
    86  	if fake.activateSpecReturnsOnCall == nil {
    87  		fake.activateSpecReturnsOnCall = make(map[int]struct {
    88  			result1 error
    89  		})
    90  	}
    91  	fake.activateSpecReturnsOnCall[i] = struct {
    92  		result1 error
    93  	}{result1}
    94  }
    95  
    96  func (fake *Logging) Spec() string {
    97  	fake.specMutex.Lock()
    98  	ret, specificReturn := fake.specReturnsOnCall[len(fake.specArgsForCall)]
    99  	fake.specArgsForCall = append(fake.specArgsForCall, struct {
   100  	}{})
   101  	fake.recordInvocation("Spec", []interface{}{})
   102  	fake.specMutex.Unlock()
   103  	if fake.SpecStub != nil {
   104  		return fake.SpecStub()
   105  	}
   106  	if specificReturn {
   107  		return ret.result1
   108  	}
   109  	fakeReturns := fake.specReturns
   110  	return fakeReturns.result1
   111  }
   112  
   113  func (fake *Logging) SpecCallCount() int {
   114  	fake.specMutex.RLock()
   115  	defer fake.specMutex.RUnlock()
   116  	return len(fake.specArgsForCall)
   117  }
   118  
   119  func (fake *Logging) SpecCalls(stub func() string) {
   120  	fake.specMutex.Lock()
   121  	defer fake.specMutex.Unlock()
   122  	fake.SpecStub = stub
   123  }
   124  
   125  func (fake *Logging) SpecReturns(result1 string) {
   126  	fake.specMutex.Lock()
   127  	defer fake.specMutex.Unlock()
   128  	fake.SpecStub = nil
   129  	fake.specReturns = struct {
   130  		result1 string
   131  	}{result1}
   132  }
   133  
   134  func (fake *Logging) SpecReturnsOnCall(i int, result1 string) {
   135  	fake.specMutex.Lock()
   136  	defer fake.specMutex.Unlock()
   137  	fake.SpecStub = nil
   138  	if fake.specReturnsOnCall == nil {
   139  		fake.specReturnsOnCall = make(map[int]struct {
   140  			result1 string
   141  		})
   142  	}
   143  	fake.specReturnsOnCall[i] = struct {
   144  		result1 string
   145  	}{result1}
   146  }
   147  
   148  func (fake *Logging) Invocations() map[string][][]interface{} {
   149  	fake.invocationsMutex.RLock()
   150  	defer fake.invocationsMutex.RUnlock()
   151  	fake.activateSpecMutex.RLock()
   152  	defer fake.activateSpecMutex.RUnlock()
   153  	fake.specMutex.RLock()
   154  	defer fake.specMutex.RUnlock()
   155  	copiedInvocations := map[string][][]interface{}{}
   156  	for key, value := range fake.invocations {
   157  		copiedInvocations[key] = value
   158  	}
   159  	return copiedInvocations
   160  }
   161  
   162  func (fake *Logging) recordInvocation(key string, args []interface{}) {
   163  	fake.invocationsMutex.Lock()
   164  	defer fake.invocationsMutex.Unlock()
   165  	if fake.invocations == nil {
   166  		fake.invocations = map[string][][]interface{}{}
   167  	}
   168  	if fake.invocations[key] == nil {
   169  		fake.invocations[key] = [][]interface{}{}
   170  	}
   171  	fake.invocations[key] = append(fake.invocations[key], args)
   172  }
   173  
   174  var _ httpadmin.Logging = new(Logging)