mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-11 22:14:02 +01:00
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:
36
orchestrator/http_test.go
Normal file
36
orchestrator/http_test.go
Normal 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!",
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user