func TestGetRoutes(t *testing.T) { routes, err := proxymgr.GetRoutes() if err != nil { t.Errorf("Failed to GET routes - %v", err) t.FailNow() } if routes[0].Domain != testRoute.Domain { t.Errorf("Read route differs from written route") } }
func TestDeleteRoute(t *testing.T) { if err := proxymgr.DeleteRoute(testRoute); err != nil { t.Errorf("Failed to DELETE route - %v", err) } routes, err := proxymgr.GetRoutes() if err != nil { t.Error(err) } if len(routes) != 0 { t.Errorf("Failed to DELETE route") } }
func TestSetRoutes(t *testing.T) { if err := proxymgr.SetRoutes([]core.Route{testRoute}); err != nil { t.Errorf("Failed to SET routes - %v", err) t.FailNow() } routes, err := proxymgr.GetRoutes() if err != nil { t.Error(err) } if len(routes) == 1 && routes[0].Domain != testRoute.Domain { t.Errorf("Read route differs from written route") } }