2019-04-09 18:24:40 +00:00
|
|
|
package inmem
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"testing"
|
|
|
|
|
2020-04-03 17:39:20 +00:00
|
|
|
platform "github.com/influxdata/influxdb/v2"
|
|
|
|
platformtesting "github.com/influxdata/influxdb/v2/testing"
|
2019-04-09 18:24:40 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func initDBRPMappingService(f platformtesting.DBRPMappingFields, t *testing.T) (platform.DBRPMappingService, func()) {
|
|
|
|
s := NewService()
|
|
|
|
ctx := context.TODO()
|
|
|
|
if err := f.Populate(ctx, s); err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
return s, func() {}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestDBRPMappingService_CreateDBRPMapping(t *testing.T) {
|
|
|
|
t.Parallel()
|
|
|
|
platformtesting.CreateDBRPMapping(initDBRPMappingService, t)
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestDBRPMappingService_FindDBRPMappingByKey(t *testing.T) {
|
|
|
|
t.Parallel()
|
|
|
|
platformtesting.FindDBRPMappingByKey(initDBRPMappingService, t)
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestDBRPMappingService_FindDBRPMappings(t *testing.T) {
|
|
|
|
t.Parallel()
|
|
|
|
platformtesting.FindDBRPMappings(initDBRPMappingService, t)
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestDBRPMappingService_DeleteDBRPMapping(t *testing.T) {
|
|
|
|
t.Parallel()
|
|
|
|
platformtesting.DeleteDBRPMapping(initDBRPMappingService, t)
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestDBRPMappingService_FindDBRPMapping(t *testing.T) {
|
|
|
|
t.Parallel()
|
|
|
|
platformtesting.FindDBRPMapping(initDBRPMappingService, t)
|
|
|
|
}
|