1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-01-29 18:04:17 +02:00
go-micro/api/router/registry/registry_test.go
Asim Aslam 0c2041e439
add events package (#2341)
* add events package

* update go version
2021-11-08 08:52:39 +00:00

35 lines
634 B
Go

package registry
import (
"testing"
"github.com/stretchr/testify/assert"
"go-micro.dev/v4/registry"
)
func TestStoreRegex(t *testing.T) {
router := newRouter()
router.store([]*registry.Service{
{
Name: "Foobar",
Version: "latest",
Endpoints: []*registry.Endpoint{
{
Name: "foo",
Metadata: map[string]string{
"endpoint": "FooEndpoint",
"description": "Some description",
"method": "POST",
"path": "^/foo/$",
"handler": "rpc",
},
},
},
Metadata: map[string]string{},
},
},
)
assert.Len(t, router.ceps["Foobar.foo"].pcreregs, 1)
}