From 0161d8e1d59b1161c12b064acaa2fbb9537bb08e Mon Sep 17 00:00:00 2001 From: Marco Vermeulen Date: Mon, 30 Oct 2017 21:28:27 +0000 Subject: [PATCH] Cut over to use new stable/beta version endpoints. --- src/main/bash/sdkman-init.sh | 4 ++-- .../specs/BetaChannelBootstrapSpec.groovy | 14 ++++++------- .../specs/VersionCacheBootstrapSpec.groovy | 20 +++++++++---------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/main/bash/sdkman-init.sh b/src/main/bash/sdkman-init.sh index db224cf6..7ef4d173 100644 --- a/src/main/bash/sdkman-init.sh +++ b/src/main/bash/sdkman-init.sh @@ -127,10 +127,10 @@ else __sdkman_echo_debug "Version cache needs updating..." if [[ "$sdkman_beta_channel" == "true" ]]; then __sdkman_echo_debug "Refreshing version cache with BETA version." - VERSION_URL="${SDKMAN_LEGACY_API}/candidates/app/beta" + VERSION_URL="${SDKMAN_CURRENT_API}/broker/download/sdkman/version/beta" else __sdkman_echo_debug "Refreshing version cache with STABLE version." - VERSION_URL="${SDKMAN_LEGACY_API}/candidates/app/stable" + VERSION_URL="${SDKMAN_CURRENT_API}/broker/download/sdkman/version/stable" fi SDKMAN_REMOTE_VERSION=$(__sdkman_secure_curl_with_timeouts "$VERSION_URL") diff --git a/src/test/groovy/sdkman/specs/BetaChannelBootstrapSpec.groovy b/src/test/groovy/sdkman/specs/BetaChannelBootstrapSpec.groovy index 907619ac..9637b18b 100644 --- a/src/test/groovy/sdkman/specs/BetaChannelBootstrapSpec.groovy +++ b/src/test/groovy/sdkman/specs/BetaChannelBootstrapSpec.groovy @@ -5,9 +5,9 @@ import sdkman.support.SdkmanEnvSpecification class BetaChannelBootstrapSpec extends SdkmanEnvSpecification { static final TWO_DAYS_AGO = System.currentTimeMillis() - (48 * 60 * 60 * 1000) - static final LEGACY_API = "http://localhost:8080/1" - static final CLI_STABLE_ENDPOINT = "$LEGACY_API/candidates/app/stable" - static final CLI_BETA_ENDPOINT = "$LEGACY_API/candidates/app/beta" + static final CURRENT_API = "http://localhost:8080/2" + static final CLI_STABLE_ENDPOINT = "$CURRENT_API/broker/download/sdkman/version/stable" + static final CLI_BETA_ENDPOINT = "$CURRENT_API/broker/download/sdkman/version/beta" File versionCache @@ -21,7 +21,7 @@ class BetaChannelBootstrapSpec extends SdkmanEnvSpecification { def betaVersion = "x.y.c" curlStub.primeWith(CLI_BETA_ENDPOINT, "echo $betaVersion") bash = sdkmanBashEnvBuilder - .withLegacyService(LEGACY_API) + .withLegacyService(CURRENT_API) .withConfiguration("sdkman_beta_channel", "true") .withVersionCache("x.y.b") .build() @@ -42,7 +42,7 @@ class BetaChannelBootstrapSpec extends SdkmanEnvSpecification { def stableVersion = "x.y.b" curlStub.primeWith(CLI_STABLE_ENDPOINT, "echo $stableVersion") bash = sdkmanBashEnvBuilder - .withLegacyService(LEGACY_API) + .withLegacyService(CURRENT_API) .withConfiguration("sdkman_beta_channel", "false") .withVersionCache("x.y.c") .build() @@ -64,7 +64,7 @@ class BetaChannelBootstrapSpec extends SdkmanEnvSpecification { def newerBetaVersion = "x.y.d" curlStub.primeWith(CLI_BETA_ENDPOINT, "echo $newerBetaVersion") bash = sdkmanBashEnvBuilder - .withLegacyService(LEGACY_API) + .withLegacyService(CURRENT_API) .withConfiguration("sdkman_beta_channel", "true") .withVersionCache("x.y.c") .build() @@ -85,7 +85,7 @@ class BetaChannelBootstrapSpec extends SdkmanEnvSpecification { def newerStableVersion = "x.y.d" curlStub.primeWith(CLI_STABLE_ENDPOINT, "echo $newerStableVersion") bash = sdkmanBashEnvBuilder - .withLegacyService(LEGACY_API) + .withLegacyService(CURRENT_API) .withConfiguration("sdkman_beta_channel", "false") .withVersionCache("x.y.c") .build() diff --git a/src/test/groovy/sdkman/specs/VersionCacheBootstrapSpec.groovy b/src/test/groovy/sdkman/specs/VersionCacheBootstrapSpec.groovy index 2af66fa3..9938b1f1 100644 --- a/src/test/groovy/sdkman/specs/VersionCacheBootstrapSpec.groovy +++ b/src/test/groovy/sdkman/specs/VersionCacheBootstrapSpec.groovy @@ -8,10 +8,10 @@ class VersionCacheBootstrapSpec extends SdkmanEnvSpecification { static final MORE_THAN_A_DAY_IN_MILLIS = 24 * 61 * 60 * 1000 - static final LEGACY_API = "http://localhost:8080/1" - static final CLI_VERSION_STABLE_ENDPOINT = "$LEGACY_API/candidates/app/stable" - static final CLI_VERSION_BETA_ENDPOINT = "$LEGACY_API/candidates/app/beta" - static final CANDIDATES_ENDPOINT = "$LEGACY_API/candidates" + static final CURRENT_API = "http://localhost:8080/2" + static final CLI_VERSION_STABLE_ENDPOINT = "$CURRENT_API/broker/download/sdkman/version/stable" + static final CLI_VERSION_BETA_ENDPOINT = "$CURRENT_API/broker/download/sdkman/version/beta" + static final CANDIDATES_ENDPOINT = "$CURRENT_API/candidates" File versionCache @@ -24,7 +24,7 @@ class VersionCacheBootstrapSpec extends SdkmanEnvSpecification { given: curlStub.primeWith(CLI_VERSION_STABLE_ENDPOINT, "echo x.y.b") bash = sdkmanBashEnvBuilder - .withLegacyService(LEGACY_API) + .withLegacyService(CURRENT_API) .build() and: @@ -60,7 +60,7 @@ class VersionCacheBootstrapSpec extends SdkmanEnvSpecification { given: curlStub.primeWith(CLI_VERSION_STABLE_ENDPOINT, "echo x.y.b") bash = sdkmanBashEnvBuilder - .withLegacyService(LEGACY_API) + .withLegacyService(CURRENT_API) .withVersionCache("x.y.a") .build() @@ -82,7 +82,7 @@ class VersionCacheBootstrapSpec extends SdkmanEnvSpecification { given: curlStub.primeWith(CLI_VERSION_STABLE_ENDPOINT, "echo ''") bash = sdkmanBashEnvBuilder - .withLegacyService(LEGACY_API) + .withLegacyService(CURRENT_API) .withVersionCache("x.y.z") .build() @@ -103,7 +103,7 @@ class VersionCacheBootstrapSpec extends SdkmanEnvSpecification { given: curlStub.primeWith(CLI_VERSION_STABLE_ENDPOINT, "echo ''") bash = sdkmanBashEnvBuilder - .withLegacyService(LEGACY_API) + .withLegacyService(CURRENT_API) .withVersionCache("x.y.z") .build() @@ -125,7 +125,7 @@ class VersionCacheBootstrapSpec extends SdkmanEnvSpecification { def sdkmanVersion = "x.y.z" curlStub.primeWith(CLI_VERSION_STABLE_ENDPOINT, "echo 'sorry'") bash = sdkmanBashEnvBuilder - .withLegacyService(LEGACY_API) + .withLegacyService(CURRENT_API) .withVersionCache(sdkmanVersion) .build() @@ -146,7 +146,7 @@ class VersionCacheBootstrapSpec extends SdkmanEnvSpecification { given: curlStub.primeWith(CLI_VERSION_BETA_ENDPOINT, "echo x.y.z") bash = sdkmanBashEnvBuilder - .withLegacyService(LEGACY_API) + .withLegacyService(CURRENT_API) .withVersionCache("x.y.w") .withConfiguration("sdkman_beta_channel", "true") .build()