Added PUT /hello test

This commit is contained in:
James Mills 2018-05-10 00:35:22 -07:00
parent b3fba70b13
commit f476a2026d
No known key found for this signature in database
GPG Key ID: AC4C014F1440EBD6

View File

@ -73,6 +73,19 @@ func TestServeHTTPPOST(t *testing.T) {
assert.Regexp(`message successfully published to hello with sequence \d+`, w.Body.String())
}
func TestServeHTTPPUT(t *testing.T) {
assert := assert.New(t)
mb := New(nil)
w := httptest.NewRecorder()
b := bytes.NewBufferString("hello world")
r, _ := http.NewRequest("PUT", "/hello", b)
mb.ServeHTTP(w, r)
assert.Equal(w.Code, http.StatusOK)
assert.Regexp(`message successfully published to hello with sequence \d+`, w.Body.String())
}
func BenchmarkMessageBusPut(b *testing.B) {
mb := New(nil)
topic := mb.NewTopic("foo")