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.
This commit is contained in:
Vincent Bernat
2022-06-11 08:12:59 +02:00
parent bf0c474726
commit ee26a468b0
5 changed files with 12 additions and 12 deletions

36
orchestrator/http_test.go Normal file
View File

@@ -0,0 +1,36 @@
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!",
},
},
})
}