Skip to content

Commit

Permalink
Improving helper function
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan Diego Gonzalez committed Nov 22, 2021
1 parent a85cf4a commit 3deb205
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions integration/helpers/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ func SkipIfUAAVersionAtLeast(version string) {
}

func matchMajorAPIVersion(minVersion string) string {
version := GetAPIVersionV2()
if strings.HasPrefix(minVersion, "3") {
version = getAPIVersionV3()
return getAPIVersionV3()
} else {
return GetAPIVersionV2()
}
return version
}

// GetAPIVersionV2 returns the V2 api version of the targeted API
Expand Down
10 changes: 5 additions & 5 deletions integration/v7/isolated/routes_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,8 @@ import (

var _ = Describe("routes command", func() {

const tableHeaders = `space\s+host\s+domain\s+port\s+path\s+protocol\s+app-protocol\s+apps\s+service instance`
appProtocolValue := "http1"
if !helpers.IsVersionMet(ccversion.MinVersionHTTP2RoutingV3) {
appProtocolValue = ""
}

const tableHeaders = `space\s+host\s+domain\s+port\s+path\s+protocol\s+app-protocol\s+apps\s+service instance`
Context("Help", func() {
It("appears in cf help -a", func() {
session := helpers.CF("help", "-a")
Expand Down Expand Up @@ -70,6 +66,10 @@ var _ = Describe("routes command", func() {

helpers.SetupCF(orgName, spaceName)
userName, _ = helpers.GetCredentials()
if !helpers.IsVersionMet(ccversion.MinVersionHTTP2RoutingV3) {
appProtocolValue = ""
}

})

AfterEach(func() {
Expand Down

0 comments on commit 3deb205

Please sign in to comment.