AlertingNG: base API implementation (#31824)
* AlertingNG: base API implementation * Pass the interface instead of the base impl * Ruler mock draft (WIP) * Update alerting-api dependency * Improve mock implementation
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestToMacaronPath(t *testing.T) {
|
||||
testCases := []struct {
|
||||
inputPath string
|
||||
expectedOutputPath string
|
||||
}{
|
||||
{
|
||||
inputPath: "",
|
||||
expectedOutputPath: "",
|
||||
},
|
||||
{
|
||||
inputPath: "/ruler/{DatasourceId}/api/v1/rules/{Namespace}/{Groupname}",
|
||||
expectedOutputPath: "/ruler/:DatasourceId/api/v1/rules/:Namespace/:Groupname",
|
||||
},
|
||||
}
|
||||
for _, tc := range testCases {
|
||||
outputPath := toMacaronPath(tc.inputPath)
|
||||
assert.Equal(t, tc.expectedOutputPath, outputPath)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user