ServiceAccounts controller

This commit is contained in:
Jordan Liggitt
2015-04-21 10:34:21 -04:00
parent 0955808668
commit 6e570732f5
4 changed files with 400 additions and 1 deletions

View File

@@ -73,13 +73,16 @@ func (f *FakeHandler) ServeHTTP(response http.ResponseWriter, request *http.Requ
f.RequestBody = string(bodyReceived)
}
func (f *FakeHandler) ValidateRequestCount(t TestInterface, count int) {
func (f *FakeHandler) ValidateRequestCount(t TestInterface, count int) bool {
ok := true
f.lock.Lock()
defer f.lock.Unlock()
if f.requestCount != count {
ok = false
t.Logf("Expected %d call, but got %d. Only the last call is recorded and checked.", count, f.requestCount)
}
f.hasBeenChecked = true
return ok
}
// ValidateRequest verifies that FakeHandler received a request with expected path, method, and body.