Chore: Move ReqContext to contexthandler service (#62102)

* Chore: Move ReqContext to contexthandler service

* Rename package to contextmodel

* Generate ngalert files

* Remove unused imports
This commit is contained in:
idafurjes
2023-01-27 08:50:36 +01:00
committed by GitHub
parent 8379a29b53
commit 6c5a573772
180 changed files with 1208 additions and 1182 deletions
+5 -5
View File
@@ -4,13 +4,13 @@ import (
"testing"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/models"
contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model"
"github.com/stretchr/testify/assert"
)
func Test_sanitizeURL(t *testing.T) {
type args struct {
ctx *models.ReqContext
ctx *contextmodel.ReqContext
s string
}
tests := []struct {
@@ -21,7 +21,7 @@ func Test_sanitizeURL(t *testing.T) {
{
name: "Receiving empty string should return it",
args: args{
ctx: &models.ReqContext{
ctx: &contextmodel.ReqContext{
Logger: log.New("test.logger"),
},
s: "",
@@ -31,7 +31,7 @@ func Test_sanitizeURL(t *testing.T) {
{
name: "Receiving valid URL string should return it parsed",
args: args{
ctx: &models.ReqContext{
ctx: &contextmodel.ReqContext{
Logger: log.New("test.logger"),
},
s: "https://grafana.com/",
@@ -41,7 +41,7 @@ func Test_sanitizeURL(t *testing.T) {
{
name: "Receiving invalid URL string should return empty string",
args: args{
ctx: &models.ReqContext{
ctx: &contextmodel.ReqContext{
Logger: log.New("test.logger"),
},
s: "this is not a valid URL",