Skip to content

Commit

Permalink
refactor(test/clouddriver): Cleanup impractical tests in TrafficGuard…
Browse files Browse the repository at this point in the history
…Spec

The API call 'front50Service.get(application)' mocked/stubbed to return null value is not realistic, because if the application is not available , then this API would throw a 404 HTTP error and thats already handled in the same class: https://github.com/spinnaker/orca/blob/7e923cc05af0f66b952245722aa69c667f685c5c/orca-clouddriver/src/test/groovy/com/netflix/spinnaker/orca/clouddriver/utils/TrafficGuardSpec.groovy#L464.

and hence this test is cleaned up.
  • Loading branch information
Pranav-b-7 authored and Pranav-b-7 committed Apr 16, 2024
1 parent 636356e commit 449c966
Showing 1 changed file with 0 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -446,15 +446,6 @@ class TrafficGuardSpec extends Specification {
"app" | "test" | null | "zz" | "test" | "us-east-1" || false // different detail
}

void "hasDisableLock returns false on missing applications"() {
when:
boolean result = trafficGuard.hasDisableLock(new Moniker(app: "app", cluster: "app"), "test", location)

then:
result == false
1 * front50Service.get("app") >> null
}

void "hasDisableLock returns false on applications with no guards configured"() {
when:
boolean result = trafficGuard.hasDisableLock(new Moniker(app: "app", cluster: "app"), "test", location)
Expand Down

0 comments on commit 449c966

Please sign in to comment.