Correlations: Add GetCorrelation(s) HTTP APIs (#52517)
* Correlations: Get Single correlations * Correlations: Get all correlations for given source ds * Correlations: Get all correlations * add tests * add DB indices * fix lint errors * remove skip from tests * use DatasourceService in test
This commit is contained in:
@@ -43,6 +43,20 @@ type User struct {
|
||||
password string
|
||||
}
|
||||
|
||||
type GetParams struct {
|
||||
url string
|
||||
user User
|
||||
}
|
||||
|
||||
func (c TestContext) Get(params GetParams) *http.Response {
|
||||
c.t.Helper()
|
||||
|
||||
resp, err := http.Get(c.getURL(params.url, params.user))
|
||||
require.NoError(c.t, err)
|
||||
|
||||
return resp
|
||||
}
|
||||
|
||||
type PostParams struct {
|
||||
url string
|
||||
body string
|
||||
@@ -127,7 +141,7 @@ func (c TestContext) createUser(cmd user.CreateUserCommand) {
|
||||
func (c TestContext) createDs(cmd *datasources.AddDataSourceCommand) {
|
||||
c.t.Helper()
|
||||
|
||||
err := c.env.SQLStore.AddDataSource(context.Background(), cmd)
|
||||
err := c.env.Server.HTTPServer.DataSourcesService.AddDataSource(context.Background(), cmd)
|
||||
require.NoError(c.t, err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user