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:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user