Skip to content
This repository has been archived by the owner on May 6, 2021. It is now read-only.

Commit

Permalink
Add one more test scenario and design refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
piyush-garg authored and chmouel committed Dec 13, 2018
1 parent a4f4720 commit b4c0df6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
5 changes: 5 additions & 0 deletions build/pipelineenv_blackbox_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
12 changes: 10 additions & 2 deletions controller/pipeline_environments_blackbox_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}
Expand Down
2 changes: 1 addition & 1 deletion design/pipelineenv.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
Expand Down

0 comments on commit b4c0df6

Please sign in to comment.