2020-06-10 13:18:03 +03:00
|
|
|
package registry
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
2020-08-20 15:23:41 +03:00
|
|
|
"github.com/unistack-org/micro/v3/registry"
|
2020-06-10 13:18:03 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestStoreRegex(t *testing.T) {
|
2020-08-27 11:32:27 +03:00
|
|
|
t.Skip()
|
|
|
|
router, err := newRouter()
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2020-06-10 13:18:03 +03:00
|
|
|
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)
|
|
|
|
}
|