cc2278086f
Feature/import * importstart * pp * tests * importtests * 100GB * lint * passtests * utc * awsprofile * doublequotes * host
42 lines
870 B
Go
42 lines
870 B
Go
package queryapi_test
|
|
|
|
import (
|
|
"net/http"
|
|
"testing"
|
|
|
|
queryapi "queryorchestration/api/queryAPI"
|
|
|
|
"github.com/google/uuid"
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestTriggerExport(t *testing.T) {
|
|
ctx, rec := createContext(t)
|
|
cfg := &ControllerConfig{}
|
|
|
|
svc := createControllerServices(cfg)
|
|
cons := queryapi.NewControllers(svc)
|
|
|
|
err := cons.TriggerExport(ctx, "clientid")
|
|
require.NoError(t, err)
|
|
assert.Equal(t, http.StatusOK, rec.Code)
|
|
assert.NotEmpty(t, rec.Body.String())
|
|
}
|
|
|
|
func TestExportState(t *testing.T) {
|
|
ctx, rec := createContext(t)
|
|
|
|
cfg := &ControllerConfig{}
|
|
|
|
svc := createControllerServices(cfg)
|
|
cons := queryapi.NewControllers(svc)
|
|
|
|
id := uuid.New()
|
|
|
|
err := cons.ExportState(ctx, id)
|
|
require.NoError(t, err)
|
|
assert.Equal(t, http.StatusOK, rec.Code)
|
|
assert.NotEmpty(t, rec.Body.String())
|
|
}
|