Added PUT /hello test
This commit is contained in:
parent
b3fba70b13
commit
f476a2026d
|
@ -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")
|
||||
|
|
Loading…
Reference in New Issue