Skip to content

Commit

Permalink
Remove all references to legacy endpoint.
Browse files Browse the repository at this point in the history
  • Loading branch information
marc0der committed Jul 14, 2018
1 parent 5ffb6cc commit 54fb038
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 38 deletions.
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ task prepareScripts(type: Copy) {
filter(ReplaceTokens, tokens:
[
SDKMAN_VERSION : sdkmanCliBuildVersion,
SDKMAN_LEGACY_API : config.sdkmanLegacyApi,
SDKMAN_CURRENT_API: config.sdkmanCurrentApi
]
)
Expand Down
2 changes: 0 additions & 2 deletions config.groovy
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
sdkmanCliVersion = 'master'
environments {
local {
sdkmanLegacyApi = 'http://localhost:8080/1'
sdkmanCurrentApi = 'http://localhost:8080/2'
}
production {
sdkmanLegacyApi = 'https://api.sdkman.io/1'
sdkmanCurrentApi = 'https://api.sdkman.io/2'
}
}
4 changes: 0 additions & 4 deletions src/main/bash/sdkman-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ if [ -z "$SDKMAN_VERSION" ]; then
export SDKMAN_VERSION="@SDKMAN_VERSION@"
fi

if [ -z "$SDKMAN_LEGACY_API" ]; then
export SDKMAN_LEGACY_API="@SDKMAN_LEGACY_API@"
fi

if [ -z "$SDKMAN_CURRENT_API" ]; then
export SDKMAN_CURRENT_API="@SDKMAN_CURRENT_API@"
fi
Expand Down
7 changes: 0 additions & 7 deletions src/test/groovy/sdkman/env/SdkmanBashEnvBuilder.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class SdkmanBashEnvBuilder {
private List candidates = ['groovy', 'grails', 'java']
private boolean offlineMode = false
private String broadcast = "This is a LIVE broadcast!"
private String legacyService = "http://localhost:8080/1"
private String currentService = "http://localhost:8080/2"
private String sdkmanVersion = "5.0.0"
private String jdkHome = "/path/to/my/jdk"
Expand Down Expand Up @@ -63,11 +62,6 @@ class SdkmanBashEnvBuilder {
this
}

SdkmanBashEnvBuilder withLegacyService(String service) {
this.legacyService = service
this
}

SdkmanBashEnvBuilder withCurrentService(String service) {
this.currentService = service
this
Expand Down Expand Up @@ -119,7 +113,6 @@ class SdkmanBashEnvBuilder {
SDKMAN_DIR : sdkmanDir.absolutePath,
SDKMAN_CANDIDATES_DIR: sdkmanCandidatesDir.absolutePath,
SDKMAN_OFFLINE_MODE : "$offlineMode",
SDKMAN_LEGACY_API : legacyService,
SDKMAN_CURRENT_API : currentService,
SDKMAN_VERSION : sdkmanVersion,
sdkman_debug_mode : 'true',
Expand Down
4 changes: 0 additions & 4 deletions src/test/groovy/sdkman/specs/BetaChannelBootstrapSpec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class BetaChannelBootstrapSpec extends SdkmanEnvSpecification {
def betaVersion = "x.y.c"
curlStub.primeWith(CLI_BETA_ENDPOINT, "echo $betaVersion")
bash = sdkmanBashEnvBuilder
.withLegacyService(CURRENT_API)
.withConfiguration("sdkman_beta_channel", "true")
.withVersionCache("x.y.b")
.build()
Expand All @@ -43,7 +42,6 @@ class BetaChannelBootstrapSpec extends SdkmanEnvSpecification {
def stableVersion = "x.y.b"
curlStub.primeWith(CLI_STABLE_ENDPOINT, "echo $stableVersion")
bash = sdkmanBashEnvBuilder
.withLegacyService(CURRENT_API)
.withConfiguration("sdkman_beta_channel", "false")
.withVersionCache("x.y.c")
.build()
Expand All @@ -67,7 +65,6 @@ class BetaChannelBootstrapSpec extends SdkmanEnvSpecification {
def newerBetaVersion = "x.y.d"
curlStub.primeWith(CLI_BETA_ENDPOINT, "echo $newerBetaVersion")
bash = sdkmanBashEnvBuilder
.withLegacyService(CURRENT_API)
.withConfiguration("sdkman_beta_channel", "true")
.withVersionCache("x.y.c")
.build()
Expand All @@ -89,7 +86,6 @@ class BetaChannelBootstrapSpec extends SdkmanEnvSpecification {
def newerStableVersion = "x.y.d"
curlStub.primeWith(CLI_STABLE_ENDPOINT, "echo $newerStableVersion")
bash = sdkmanBashEnvBuilder
.withLegacyService(CURRENT_API)
.withConfiguration("sdkman_beta_channel", "false")
.withVersionCache("x.y.c")
.build()
Expand Down
11 changes: 1 addition & 10 deletions src/test/groovy/sdkman/specs/CandidatesCacheUpdateSpec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,16 @@ import sdkman.support.SdkmanEnvSpecification

class CandidatesCacheUpdateSpec extends SdkmanEnvSpecification {

static final LEGACY_API = "http://localhost:8080/1"
static final CURRENT_API = "http://localhost:8080/2"

static final LEGACY_VERSIONS_STABLE_ENDPOINT = "$LEGACY_API/candidates/app/stable"
static final LEGACY_VERSIONS_BETA_ENDPOINT = "$LEGACY_API/candidates/app/beta"
static final BROADCAST_API_LATEST_ID_ENDPOINT = "$CURRENT_API/broadcast/latest/id"
static final CANDIDATES_ALL_ENDPOINT = "$CURRENT_API/candidates/all"

File candidatesCache

def setup() {
candidatesCache = new File("${sdkmanDotDirectory}/var", "candidates")
curlStub.primeWith(LEGACY_VERSIONS_STABLE_ENDPOINT, "echo x.y.y")
.primeWith(LEGACY_VERSIONS_BETA_ENDPOINT, "echo x.y.z")
.primeWith(BROADCAST_API_LATEST_ID_ENDPOINT, "echo dbfb025be9f97fda2052b5febcca0155")
curlStub.primeWith(BROADCAST_API_LATEST_ID_ENDPOINT, "echo dbfb025be9f97fda2052b5febcca0155")
.primeWith(CANDIDATES_ALL_ENDPOINT, "echo groovy,scala")
sdkmanBashEnvBuilder.withConfiguration("sdkman_debug_mode", "true")
}
Expand All @@ -27,7 +22,6 @@ class CandidatesCacheUpdateSpec extends SdkmanEnvSpecification {
given:
bash = sdkmanBashEnvBuilder
.withCandidates([])
.withLegacyService(LEGACY_API)
.build()

and:
Expand All @@ -48,7 +42,6 @@ class CandidatesCacheUpdateSpec extends SdkmanEnvSpecification {
void "should issue a warning if cache is older than a month"() {
given:
bash = sdkmanBashEnvBuilder
.withLegacyService(LEGACY_API)
.withCandidates(['groovy'])
.build()

Expand All @@ -73,7 +66,6 @@ class CandidatesCacheUpdateSpec extends SdkmanEnvSpecification {
void "should log a success message in debug mode when no update needed"() {
given:
bash = sdkmanBashEnvBuilder
.withLegacyService(LEGACY_API)
.withCandidates(['groovy'])
.build()

Expand All @@ -95,7 +87,6 @@ class CandidatesCacheUpdateSpec extends SdkmanEnvSpecification {
given:
bash = sdkmanBashEnvBuilder
.withCandidates([])
.withLegacyService(LEGACY_API)
.build()

and:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ class VersionCacheBootstrapSpec extends SdkmanEnvSpecification {
void "should store version cache if does not exist"() {
given:
curlStub.primeWith(CLI_VERSION_STABLE_ENDPOINT, "echo x.y.b")
bash = sdkmanBashEnvBuilder
.withLegacyService(CURRENT_API)
.build()
bash = sdkmanBashEnvBuilder.build()

and:
bash.start()
Expand Down Expand Up @@ -62,7 +60,6 @@ class VersionCacheBootstrapSpec extends SdkmanEnvSpecification {
given:
curlStub.primeWith(CLI_VERSION_STABLE_ENDPOINT, "echo x.y.b")
bash = sdkmanBashEnvBuilder
.withLegacyService(CURRENT_API)
.withVersionCache("x.y.a")
.build()

Expand All @@ -85,7 +82,6 @@ class VersionCacheBootstrapSpec extends SdkmanEnvSpecification {
given:
curlStub.primeWith(CLI_VERSION_STABLE_ENDPOINT, "echo ''")
bash = sdkmanBashEnvBuilder
.withLegacyService(CURRENT_API)
.withVersionCache("x.y.z")
.build()

Expand All @@ -107,7 +103,6 @@ class VersionCacheBootstrapSpec extends SdkmanEnvSpecification {
given:
curlStub.primeWith(CLI_VERSION_STABLE_ENDPOINT, "echo ''")
bash = sdkmanBashEnvBuilder
.withLegacyService(CURRENT_API)
.withVersionCache("x.y.z")
.build()

Expand All @@ -130,7 +125,6 @@ class VersionCacheBootstrapSpec extends SdkmanEnvSpecification {
def sdkmanVersion = "x.y.z"
curlStub.primeWith(CLI_VERSION_STABLE_ENDPOINT, "echo '<html><title>sorry</title></html>'")
bash = sdkmanBashEnvBuilder
.withLegacyService(CURRENT_API)
.withVersionCache(sdkmanVersion)
.build()

Expand All @@ -152,7 +146,6 @@ class VersionCacheBootstrapSpec extends SdkmanEnvSpecification {
given:
curlStub.primeWith(CLI_VERSION_BETA_ENDPOINT, "echo x.y.z")
bash = sdkmanBashEnvBuilder
.withLegacyService(CURRENT_API)
.withVersionCache("x.y.w")
.withConfiguration("sdkman_beta_channel", "true")
.build()
Expand Down
2 changes: 0 additions & 2 deletions src/test/groovy/sdkman/steps/initialisation_steps.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ And(~'^a machine with "(.*)" installed$') { String platform ->
And(~'^an initialised environment$') {->
bash = SdkmanBashEnvBuilder.create(sdkmanBaseDir)
.withOfflineMode(offlineMode)
.withLegacyService(serviceUrlEnv)
.withCurrentService(serviceUrlEnv)
.withJdkHome(javaHome)
.withHttpProxy(HTTP_PROXY)
Expand All @@ -104,7 +103,6 @@ And(~'^an initialised environment$') {->
And(~'^an outdated initialised environment$') {->
bash = SdkmanBashEnvBuilder.create(sdkmanBaseDir)
.withOfflineMode(offlineMode)
.withLegacyService(serviceUrlEnv)
.withCurrentService(serviceUrlEnv)
.withJdkHome(javaHome)
.withHttpProxy(HTTP_PROXY)
Expand Down

0 comments on commit 54fb038

Please sign in to comment.