func TestPanicOnMultipleGetHandlers(t *testing.T) {
	defer func() {
		v := recover()
		if v == nil {
			t.Fatalf("expected a panic, but nothing happened")
		}
	}()
	runTest(t, func(s *res.Service) {
		s.Handle("model",
			res.GetModel(func(r res.ModelRequest) {
				r.NotFound()
			}),
			res.GetCollection(func(r res.CollectionRequest) {
				r.NotFound()
			}),
		)
	}, nil)
}
Test that registering both a model and collection handler results
in a panic
package test
import (
	"testing"
	"github.com/jirenius/go-res"
	"github.com/jirenius/go-res/restest"
)
func TestRegisterModelHandler(t *testing.T) {
	runTest(t, func(s *res.Service) {
		s.Handle("model", res.GetModel(func(r res.ModelRequest) { r.NotFound() }))
	}, func(s *restest.Session) {
		s.AssertQueueSubscription("get.test", "test")
		s.AssertQueueSubscription("get.test.>", "test")
		s.AssertQueueSubscription("call.test.>", "test")
		s.AssertNoSubscription("call.test")
		s.AssertQueueSubscription("auth.test.>", "test")
		s.AssertNoSubscription("auth.test")
		s.AssertNoSubscription("access.test.>")
		s.AssertNoSubscription("access.test")
	}, restest.WithReset([]string{"test", "test.>"}, nil))
}
func TestRegisterAccessHandler(t *testing.T) {
	runTest(t, func(s *res.Service) {
		s.Handle("model", res.Access(res.AccessGranted))
	}, func(s *restest.Session) {
		s.AssertNoSubscription("get.test")
		s.AssertNoSubscription("get.test.>")
		s.AssertNoSubscription("call.test.>")
		s.AssertNoSubscription("call.test")
		s.AssertNoSubscription("auth.test.>")
		s.AssertNoSubscription("auth.test")
		s.AssertQueueSubscription("access.test.>", "test")
		s.AssertQueueSubscription("access.test", "test")
	}, restest.WithReset(nil, []string{"test", "test.>"}))
}
func TestRegisterModelAndAccessHandler(t *testing.T) {
	runTest(t, func(s *res.Service) {
		s.Handle("model",
			res.GetModel(func(r res.ModelRequest) { r.NotFound() }),
			res.Access(res.AccessGranted),
		)
	}, func(s *restest.Session) {
		s.AssertQueueSubscription("get.test", "test")
		s.AssertQueueSubscription("get.test.>", "test")
		s.AssertQueueSubscription("call.test.>", "test")
		s.AssertNoSubscription("call.test")
		s.AssertQueueSubscription("auth.test.>", "test")
		s.AssertNoSubscription("auth.test")
		s.AssertQueueSubscription("access.test.>", "test")
		s.AssertQueueSubscription("access.test", "test")
	}, restest.WithReset([]string{"test", "test.>"}, []string{"test", "test.>"}))
}