Merged in feature/apitidyup (pull request #24)
Export API Clean Up * exportapi
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/go-playground/validator/v10"
|
||||
"github.com/google/uuid"
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
@@ -25,3 +26,19 @@ func TestTriggerExport(t *testing.T) {
|
||||
assert.Equal(t, http.StatusOK, rec.Code)
|
||||
assert.NotEmpty(t, rec.Body.String())
|
||||
}
|
||||
|
||||
func TestExportState(t *testing.T) {
|
||||
e := echo.New()
|
||||
req := httptest.NewRequest(http.MethodPost, "/", strings.NewReader(""))
|
||||
rec := httptest.NewRecorder()
|
||||
ctx := e.NewContext(req, rec)
|
||||
|
||||
cons := queryservice.NewControllers(validator.New(), &queryservice.Services{})
|
||||
|
||||
id := uuid.NewString()
|
||||
|
||||
err := cons.ExportState(ctx, id)
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, http.StatusOK, rec.Code)
|
||||
assert.NotEmpty(t, rec.Body.String())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user