Skip to content

Commit

Permalink
refactor(test/applications): Cleanup impractical tests in UpsertAppli…
Browse files Browse the repository at this point in the history
…cationTaskSpec

The API call 'front50Service.get(application)' mocked/stubbed to return null value is not realistic, because if the application is not present, then this API would throw a 404 HTTP error.

and hence this test is cleaned up.
  • Loading branch information
Pranav-b-7 committed Apr 10, 2024
1 parent 0c98673 commit 8efeabf
Showing 1 changed file with 0 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,6 @@ class UpsertApplicationTaskSpec extends Specification {
}
}

void "should create an application in global registries"() {
given:
def app = new Application(config.application + [user: config.user])
task.front50Service = Mock(Front50Service) {
1 * get(config.application.name) >> null
1 * create(app)
1 * updatePermission(*_)
0 * _._
}

when:
def result = task.execute(pipeline.stages.first())

then:
result.status == ExecutionStatus.SUCCEEDED
}

void "should update existing application"() {
given:
Application application = new Application(config.application + [
Expand Down

0 comments on commit 8efeabf

Please sign in to comment.