Skip to content

Commit

Permalink
add check for errors and clean service at the end of the test
Browse files Browse the repository at this point in the history
  • Loading branch information
antoine.choimet committed Aug 1, 2022
1 parent 09da9be commit ba0e275
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions kong/plugin_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ func (s *PluginService) Delete(ctx context.Context,

endpoint := fmt.Sprintf("/plugins/%v", *pluginID)
_, err := s.sendRequest(ctx, nil, endpoint, "DELETE")
if err != nil {
return err
}
return err
}

Expand All @@ -198,6 +201,9 @@ func (s *PluginService) DeleteForService(ctx context.Context,

endpoint := fmt.Sprintf("/services/%v/plugins/%v", *serviceIDorName, *pluginID)
_, err := s.sendRequest(ctx, nil, endpoint, "DELETE")
if err != nil {
return err
}
return err
}

Expand Down
2 changes: 2 additions & 0 deletions kong/plugin_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ func TestPluginsService(T *testing.T) {

err = client.Plugins.DeleteForService(defaultCtx, createdService.Name, updatedPlugin.ID)
assert.NoError(err)

assert.NoError(client.Services.Delete(defaultCtx, createdService.ID))
}

func TestPluginWithTags(T *testing.T) {
Expand Down

0 comments on commit ba0e275

Please sign in to comment.