Added update action to manageServiceRoutes. Table is embedded; skip opts

This commit is contained in:
Milos Gajdos
2019-07-10 21:28:32 +01:00
parent 1f744b31a4
commit a0ee7d2092
3 changed files with 27 additions and 20 deletions

View File

@@ -94,12 +94,13 @@ func TestUpdate(t *testing.T) {
t.Errorf("invalid number of routes. Expected: %d, found: %d", testTableSize, table.Size())
}
// this should error as the destination does not exist
// this should add a new route
route.Service = "rand.dest"
if err := table.Update(route); err != ErrRouteNotFound {
t.Errorf("error updating route. Expected error: %s, found: %s", ErrRouteNotFound, err)
if err := table.Update(route); err != nil {
t.Errorf("error updating route: %s", err)
}
testTableSize += 1
if table.Size() != testTableSize {
t.Errorf("invalid number of routes. Expected: %d, found: %d", testTableSize, table.Size())