2021-01-16 01:12:18 +03:00
|
|
|
// +build ignore
|
|
|
|
|
2021-01-29 15:08:17 +03:00
|
|
|
package register
|
2020-07-27 15:22:00 +03:00
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"testing"
|
|
|
|
|
2021-01-29 15:08:17 +03:00
|
|
|
"github.com/unistack-org/micro/v3/register/memory"
|
2021-01-16 01:12:18 +03:00
|
|
|
"github.com/unistack-org/micro/v3/router"
|
2020-07-27 15:22:00 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
func routerTestSetup() router.Router {
|
2021-01-29 15:08:17 +03:00
|
|
|
r := memory.NewRegister()
|
|
|
|
return NewRouter(router.Register(r))
|
2020-07-27 15:22:00 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
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")
|
|
|
|
}
|
|
|
|
}
|