2021-01-16 01:12:18 +03:00
|
|
|
// +build ignore
|
|
|
|
|
2020-07-27 15:22:00 +03:00
|
|
|
package registry
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"testing"
|
|
|
|
|
2021-01-16 01:12:18 +03:00
|
|
|
"github.com/unistack-org/micro/v3/registry/memory"
|
|
|
|
"github.com/unistack-org/micro/v3/router"
|
2020-07-27 15:22:00 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
func routerTestSetup() router.Router {
|
|
|
|
r := memory.NewRegistry()
|
|
|
|
return NewRouter(router.Registry(r))
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestRouterClose(t *testing.T) {
|
|
|
|
r := routerTestSetup()
|
|
|
|
|
|
|
|
if err := r.Close(); err != nil {
|
|
|
|
t.Errorf("failed to stop router: %v", err)
|
|
|
|
}
|
2021-01-16 01:12:18 +03:00
|
|
|
if len(os.Getenv("INTEGRATION_TESTS")) == 0 {
|
2020-07-27 15:22:00 +03:00
|
|
|
t.Logf("TestRouterStartStop STOPPED")
|
|
|
|
}
|
|
|
|
}
|