From 449c966b8553335d29123e65c69ac3f7b23b2ac4 Mon Sep 17 00:00:00 2001 From: Pranav-b-7 Date: Mon, 8 Apr 2024 17:55:14 +0530 Subject: [PATCH] refactor(test/clouddriver): Cleanup impractical tests in TrafficGuardSpec 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. --- .../orca/clouddriver/utils/TrafficGuardSpec.groovy | 9 --------- 1 file changed, 9 deletions(-) diff --git a/orca-clouddriver/src/test/groovy/com/netflix/spinnaker/orca/clouddriver/utils/TrafficGuardSpec.groovy b/orca-clouddriver/src/test/groovy/com/netflix/spinnaker/orca/clouddriver/utils/TrafficGuardSpec.groovy index 29acb62699..ecf73bb216 100644 --- a/orca-clouddriver/src/test/groovy/com/netflix/spinnaker/orca/clouddriver/utils/TrafficGuardSpec.groovy +++ b/orca-clouddriver/src/test/groovy/com/netflix/spinnaker/orca/clouddriver/utils/TrafficGuardSpec.groovy @@ -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)