Files
akvorado/orchestrator/http_test.go
Vincent Bernat ee26a468b0 orchestrator: move broker component as orchestrator
We can have one main subcomponent per component. We don't do that for
the inlet component as there is more configuration.
2022-06-13 09:50:43 +02:00

37 lines
729 B
Go

package orchestrator
import (
"testing"
"akvorado/common/helpers"
"akvorado/common/http"
"akvorado/common/reporter"
"github.com/gin-gonic/gin"
)
func TestConfigurationEndpoint(t *testing.T) {
r := reporter.NewMock(t)
h := http.NewMock(t, r)
c, err := New(r, DefaultConfiguration(), Dependencies{
HTTP: h,
})
if err != nil {
t.Fatalf("New() error:\n%+v", err)
}
c.RegisterConfiguration(InletService, map[string]string{
"hello": "Hello world!",
"bye": "Goodbye world!",
})
helpers.TestHTTPEndpoints(t, h.Address, helpers.HTTPEndpointCases{
{
URL: "/api/v0/orchestrator/broker/configuration/inlet",
JSONOutput: gin.H{
"bye": "Goodbye world!",
"hello": "Hello world!",
},
},
})
}