Fix test for ENT (#11941)

This commit is contained in:
Chris S. Kim 2022-01-05 12:24:44 -05:00 committed by GitHub
parent 5f6bf369af
commit 407b0b8963
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -2149,12 +2149,14 @@ func TestState_RemoveServiceErrorMessages(t *testing.T) {
require.NoError(err)
// Attempt to remove service that doesn't exist
err = state.RemoveService(structs.NewServiceID("db", nil))
require.Contains(err.Error(), `Unknown service ID "db"`)
sid := structs.NewServiceID("db", nil)
err = state.RemoveService(sid)
require.Contains(err.Error(), fmt.Sprintf(`Unknown service ID %q`, sid))
// Attempt to remove service by name (which isn't valid)
err = state.RemoveService(structs.NewServiceID("web-name", nil))
require.Contains(err.Error(), `Unknown service ID "web-name"`)
sid2 := structs.NewServiceID("web-name", nil)
err = state.RemoveService(sid2)
require.Contains(err.Error(), fmt.Sprintf(`Unknown service ID %q`, sid2))
// Attempt to remove service by id (valid)
err = state.RemoveService(structs.NewServiceID("web-id", nil))