X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=pkg%2Fresthooks%2Fresthooks_test.go;h=39ff3f398cb8dbd5193f9e06b1cc09943438d108;hb=f95c1d3a137db6a4dd4ff7d8c3a8f5a2a7a55c2f;hp=8e2dfcc735413b235a5de45d9284adcd386755fe;hpb=d8d204f3ca9ebfd256043f6a0de526887fdcace9;p=ric-plt%2Fricdms.git diff --git a/pkg/resthooks/resthooks_test.go b/pkg/resthooks/resthooks_test.go index 8e2dfcc..39ff3f3 100644 --- a/pkg/resthooks/resthooks_test.go +++ b/pkg/resthooks/resthooks_test.go @@ -33,10 +33,12 @@ import ( "testing" ch "gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/charts" + "gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/deploy" "gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/health" "gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/models" "gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/onboard" "gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/restapi/operations/charts" + d "gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/restapi/operations/deploy" h "gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/restapi/operations/health" "gerrit.o-ran-sc.org/r/ric-plt/ricdms/pkg/ricdms" "github.com/stretchr/testify/assert" @@ -56,6 +58,7 @@ func TestMain(m *testing.M) { HealthChecker: HealthCheckerMock{}, Onboarder: onboard.NewOnboarder(), ChartMgr: ch.NewChartmgr(), + DeployMgr: deploy.NewDeploymentManager(), } code := m.Run() os.Exit(code) @@ -201,6 +204,14 @@ func TestGetChartsByNameAndVersion(t *testing.T) { assert.IsType(t, &charts.GetChartsFetcherOK{}, resp, "response did not match type") } +func TestDownloadAndInstall(t *testing.T) { + response := rh.DownloadAndInstallChart("sample app", "1.0.0", "test") + if _, ok := response.(*d.PostDeployInternalServerError); !ok { + assert.Fail(t, "response type did not match (actual) %T", response) + } + +} + type HealthCheckerMock struct { mock.Mock }