feat: command validation
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package router_test
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/google/uuid"
|
||||
"github.com/iliadenisov/galaxy/internal/model/rest"
|
||||
@@ -24,5 +26,14 @@ func (e *dummyExecutor) GameState() (rest.StateResponse, error) {
|
||||
}
|
||||
|
||||
func setupRouter() *gin.Engine {
|
||||
gin.SetMode(gin.TestMode)
|
||||
return router.SetupRouter(&dummyExecutor{})
|
||||
}
|
||||
|
||||
func encodeCommand(cmd any) json.RawMessage {
|
||||
v, err := json.Marshal(cmd)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user