1// Code generated by counterfeiter. DO NOT EDIT.
2package tracingfakes
3
4import (
5	"sync"
6
7	"go.opentelemetry.io/otel/api/trace"
8)
9
10type FakeProvider struct {
11	TracerStub        func(string) trace.Tracer
12	tracerMutex       sync.RWMutex
13	tracerArgsForCall []struct {
14		arg1 string
15	}
16	tracerReturns struct {
17		result1 trace.Tracer
18	}
19	tracerReturnsOnCall map[int]struct {
20		result1 trace.Tracer
21	}
22	invocations      map[string][][]interface{}
23	invocationsMutex sync.RWMutex
24}
25
26func (fake *FakeProvider) Tracer(arg1 string) trace.Tracer {
27	fake.tracerMutex.Lock()
28	ret, specificReturn := fake.tracerReturnsOnCall[len(fake.tracerArgsForCall)]
29	fake.tracerArgsForCall = append(fake.tracerArgsForCall, struct {
30		arg1 string
31	}{arg1})
32	fake.recordInvocation("Tracer", []interface{}{arg1})
33	fake.tracerMutex.Unlock()
34	if fake.TracerStub != nil {
35		return fake.TracerStub(arg1)
36	}
37	if specificReturn {
38		return ret.result1
39	}
40	fakeReturns := fake.tracerReturns
41	return fakeReturns.result1
42}
43
44func (fake *FakeProvider) TracerCallCount() int {
45	fake.tracerMutex.RLock()
46	defer fake.tracerMutex.RUnlock()
47	return len(fake.tracerArgsForCall)
48}
49
50func (fake *FakeProvider) TracerCalls(stub func(string) trace.Tracer) {
51	fake.tracerMutex.Lock()
52	defer fake.tracerMutex.Unlock()
53	fake.TracerStub = stub
54}
55
56func (fake *FakeProvider) TracerArgsForCall(i int) string {
57	fake.tracerMutex.RLock()
58	defer fake.tracerMutex.RUnlock()
59	argsForCall := fake.tracerArgsForCall[i]
60	return argsForCall.arg1
61}
62
63func (fake *FakeProvider) TracerReturns(result1 trace.Tracer) {
64	fake.tracerMutex.Lock()
65	defer fake.tracerMutex.Unlock()
66	fake.TracerStub = nil
67	fake.tracerReturns = struct {
68		result1 trace.Tracer
69	}{result1}
70}
71
72func (fake *FakeProvider) TracerReturnsOnCall(i int, result1 trace.Tracer) {
73	fake.tracerMutex.Lock()
74	defer fake.tracerMutex.Unlock()
75	fake.TracerStub = nil
76	if fake.tracerReturnsOnCall == nil {
77		fake.tracerReturnsOnCall = make(map[int]struct {
78			result1 trace.Tracer
79		})
80	}
81	fake.tracerReturnsOnCall[i] = struct {
82		result1 trace.Tracer
83	}{result1}
84}
85
86func (fake *FakeProvider) Invocations() map[string][][]interface{} {
87	fake.invocationsMutex.RLock()
88	defer fake.invocationsMutex.RUnlock()
89	fake.tracerMutex.RLock()
90	defer fake.tracerMutex.RUnlock()
91	copiedInvocations := map[string][][]interface{}{}
92	for key, value := range fake.invocations {
93		copiedInvocations[key] = value
94	}
95	return copiedInvocations
96}
97
98func (fake *FakeProvider) recordInvocation(key string, args []interface{}) {
99	fake.invocationsMutex.Lock()
100	defer fake.invocationsMutex.Unlock()
101	if fake.invocations == nil {
102		fake.invocations = map[string][][]interface{}{}
103	}
104	if fake.invocations[key] == nil {
105		fake.invocations[key] = [][]interface{}{}
106	}
107	fake.invocations[key] = append(fake.invocations[key], args)
108}
109
110var _ trace.Provider = new(FakeProvider)
111