func (t *AddLogTest) TestBadToken() { lg := new(commons.SingleLog) lg.Application = "test" lg.ApplicationToken = "badToken" lg.Level = "ERROR" lg.Message = "If you see this there is a problem" bJson, _ := json.Marshal(lg) println(string(bJson)) t.Put("/api/log", "application/json", bytes.NewReader(bJson)) t.AssertContainsRegex("\"success\"[ ]*:[ ]*false") t.AssertStatus(200) t.AssertContentType("application/json; charset=utf-8") }