diff --git a/build/pipelineenv_blackbox_test.go b/build/pipelineenv_blackbox_test.go index 78d1286..d743a8f 100644 --- a/build/pipelineenv_blackbox_test.go +++ b/build/pipelineenv_blackbox_test.go @@ -84,6 +84,11 @@ func (s *BuildRepositorySuite) TestList() { require.NoError(s.T(), err) assert.NotNil(s.T(), env) assert.Equal(s.T(), 2, len(env)) + + env2, err2 := s.buildRepo.List(context.Background(), uuid.NewV4()) + require.NoError(s.T(), err2) + assert.NotNil(s.T(), env2) + assert.Equal(s.T(), 0, len(env2)) } func newPipeline(name string, spaceID, envUUID uuid.UUID) *build.Pipeline { diff --git a/controller/pipeline_environments_blackbox_test.go b/controller/pipeline_environments_blackbox_test.go index be0ce1b..493d08c 100644 --- a/controller/pipeline_environments_blackbox_test.go +++ b/controller/pipeline_environments_blackbox_test.go @@ -285,8 +285,16 @@ func (s *PipelineEnvironmentControllerSuite) TestShow() { }) s.T().Run("not_found", func(t *testing.T) { - envID := uuid.NewV4() - _, err := test.ShowPipelineEnvironmentsNotFound(t, s.ctx2, s.svc2, s.ctrl2, envID) + spaceID := uuid.NewV4() + env1ID := uuid.NewV4() + env2ID := uuid.NewV4() + s.createGockONSpace(spaceID, "space1") + s.createGockONEnvList(spaceID, env1ID, env2ID) + payload := newPipelineEnvironmentPayload("osio-stage-show", env1ID) + _, newEnv := test.CreatePipelineEnvironmentsCreated(t, s.ctx2, s.svc2, s.ctrl2, spaceID, payload) + require.NotNil(t, newEnv) + + _, err := test.ShowPipelineEnvironmentsNotFound(t, s.ctx2, s.svc2, s.ctrl2, uuid.NewV4()) assert.NotNil(t, err) }) } diff --git a/design/pipelineenv.go b/design/pipelineenv.go index ea10f5f..609c2c8 100644 --- a/design/pipelineenv.go +++ b/design/pipelineenv.go @@ -74,7 +74,7 @@ var _ = a.Resource("PipelineEnvironments", func() { ) a.Response(d.OK, pipelineEnvList) a.Response(d.InternalServerError, JSONAPIErrors) - a.Response(d.NotFound, JSONAPIErrors) + a.Response(d.BadRequest, JSONAPIErrors) a.Response(d.Unauthorized, JSONAPIErrors) a.Response(d.Forbidden, JSONAPIErrors) })