Added GET / (empty) test
This commit is contained in:
parent
dd992ab5d8
commit
03e0fb07c7
|
@ -1,6 +1,8 @@
|
|||
package msgbus
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
@ -45,6 +47,18 @@ func TestMessageBusPutGet(t *testing.T) {
|
|||
assert.Equal(t, actual, expected)
|
||||
}
|
||||
|
||||
func TestServeHTTPGETEmpty(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
mb := New(nil)
|
||||
w := httptest.NewRecorder()
|
||||
r, _ := http.NewRequest("GET", "/", nil)
|
||||
|
||||
mb.ServeHTTP(w, r)
|
||||
assert.Equal(w.Code, http.StatusOK)
|
||||
assert.Equal(w.Body.String(), "{}")
|
||||
}
|
||||
|
||||
func BenchmarkMessageBusPut(b *testing.B) {
|
||||
mb := New(nil)
|
||||
topic := mb.NewTopic("foo")
|
||||
|
|
Loading…
Reference in New Issue