Skip to content

Commit 53a7b99

Browse files
committed
Remove remnants of pre/post hooks
1 parent b6d270a commit 53a7b99

File tree

9 files changed

+0
-126
lines changed

9 files changed

+0
-126
lines changed

src/test/groovy/sdkman/steps/stub_steps.groovy

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,13 @@ import io.cucumber.datatable.DataTable
44
import sdkman.support.UnixUtils
55

66
import static cucumber.api.groovy.EN.And
7-
import static sdkman.stubs.HookResponses.*
87
import static sdkman.stubs.WebServiceStub.*
98
import static sdkman.support.FilesystemUtils.readCurrentFromCandidateFolder
109
import static sdkman.support.FilesystemUtils.readVersionsCsvFromCandidateFolder
1110

1211
And(~'^the default "([^"]*)" version is "([^"]*)"$') { String candidate, String version ->
1312
primeEndpointWithString("/candidates/default/${candidate}", version)
1413
primeDownloadFor(SERVICE_UP_URL, candidate, version, UnixUtils.inferPlatform())
15-
primeEndpointWithString("/hooks/pre/${candidate}/${version}/${UnixUtils.inferPlatform()}", preInstallationHookSuccess())
16-
primeEndpointWithString("/hooks/post/${candidate}/${version}/${UnixUtils.inferPlatform()}", postInstallationHookSuccess())
1714
}
1815

1916
And(~'^an available selfupdate$') { ->
@@ -24,28 +21,12 @@ And(~'^an available selfupdate$') { ->
2421
And(~'^the candidate "([^"]*)" version "([^"]*)" is available for download$') { String candidate, String version ->
2522
primeEndpointWithString("/candidates/validate/${candidate}/${version}/${UnixUtils.inferPlatform()}", "valid")
2623
primeDownloadFor(SERVICE_UP_URL, candidate, version, UnixUtils.inferPlatform())
27-
primeEndpointWithString("/hooks/pre/${candidate}/${version}/${UnixUtils.inferPlatform()}", preInstallationHookSuccess())
28-
primeEndpointWithString("/hooks/post/${candidate}/${version}/${UnixUtils.inferPlatform()}", postInstallationHookSuccess())
2924
}
3025

3126
And(~'^the candidate "([^"]*)" version "([^"]*)" is available for download with checksum "([^"]*)" using algorithm "([^"]*)"$') {
3227
String candidate, String version, String checksum, String algorithm ->
3328
primeEndpointWithString("/candidates/validate/${candidate}/${version}/${UnixUtils.inferPlatform()}", "valid")
3429
primeDownloadFor(SERVICE_UP_URL, candidate, version, UnixUtils.inferPlatform(), ["X-Sdkman-Checksum-${algorithm}": "${checksum}"])
35-
primeEndpointWithString("/hooks/pre/${candidate}/${version}/${UnixUtils.inferPlatform()}", preInstallationHookSuccess())
36-
primeEndpointWithString("/hooks/post/${candidate}/${version}/${UnixUtils.inferPlatform()}", postInstallationHookSuccess())
37-
}
38-
39-
And(~/^the appropriate universal hooks are available for "([^"]*)" version "([^"]*)" on "([^"]*)"$/) { String candidate, String version, String os ->
40-
String lcPlatform = UnixUtils.inferPlatform(os)
41-
primeUniversalHookFor("pre", candidate, version, lcPlatform)
42-
primeUniversalHookFor("post", candidate, version, lcPlatform)
43-
}
44-
45-
And(~/^the appropriate multi-platform hooks are available for "([^"]*)" version "([^"]*)" on "([^"]*)" with architecture "(.*)"$/) { String candidate, String version, String os, String architecture ->
46-
String lcPlatform = UnixUtils.inferPlatform(os, architecture)
47-
primePlatformSpecificHookFor("pre", candidate, version, lcPlatform)
48-
primePlatformSpecificHookFor("post", candidate, version, lcPlatform)
4930
}
5031

5132
And(~'^the candidate "([^"]*)" version "([^"]*)" is not available for download$') { String candidate, String version ->
@@ -58,16 +39,6 @@ And(~/^the candidate "(.*)" version "(.*)" is available for download on "(.*)" w
5839
primeDownloadFor(SERVICE_UP_URL, candidate, version, lcPlatform)
5940
}
6041

61-
And(~/^a "([^"]*)" install hook is served for "([^"]*)" "([^"]*)" on "([^"]*)" with architecture "([^"]*)" that returns successfully$/) { String phase, String candidate, String version, String os, String architecture ->
62-
String lcPlatform = UnixUtils.inferPlatform(os, architecture)
63-
primeEndpointWithString("/hooks/${phase}/${candidate}/${version}/${lcPlatform}", phase == "pre" ? preInstallationHookSuccess() : postInstallationHookSuccess())
64-
}
65-
66-
And(~/^a "([^"]*)" install hook is served for "([^"]*)" "([^"]*)" on "([^"]*)" with architecture "([^"]*)" that returns a failure$/) { String phase, String candidate, String version, String os, String architecture ->
67-
String lcPlatform = UnixUtils.inferPlatform(os, architecture)
68-
primeEndpointWithString("/hooks/${phase}/${candidate}/${version}/${lcPlatform}", phase == "pre" ? preInstallationHookFailure() : postInstallationHookFailure())
69-
}
70-
7142
And(~/^the candidate "(.*?)" version "(.*?)" is not available for download on "(.*?)"$/) { String candidate, String version, String os ->
7243
String lcPlatform = UnixUtils.inferPlatform(os)
7344
primeEndpointWithString("/candidates/validate/${candidate}/${version}/${lcPlatform}", "invalid")

src/test/groovy/sdkman/stubs/HookResponses.groovy

Lines changed: 0 additions & 45 deletions
This file was deleted.

src/test/groovy/sdkman/stubs/WebServiceStub.groovy

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,6 @@ class WebServiceStub {
1212
.withBody(body)))
1313
}
1414

15-
static primeUniversalHookFor(String phase, String candidate, String version, String platform) {
16-
primeHookFor(phase, candidate, version, platform, true)
17-
}
18-
19-
static primePlatformSpecificHookFor(String phase, String candidate, String version, String platform) {
20-
primeHookFor(phase, candidate, version, platform, false)
21-
}
22-
23-
private static primeHookFor(String phase, String candidate, String version, String platform, boolean universal = true) {
24-
def hookFile = "hooks/${phase}_hook_${candidate}_${version}_${universal ? 'universal' : platform}.sh"
25-
stubFor(get(urlEqualTo("/hooks/$phase/$candidate/$version/$platform")).willReturn(
26-
aResponse()
27-
.withStatus(200)
28-
.withHeader("Content-Type", "text/plain")
29-
.withBodyFile(hookFile)))
30-
}
31-
3215
static primeDownloadFor(String host, String candidate, String version, String platform) {
3316
primeDownloadFor(host, candidate, version, platform, [:])
3417
}

src/test/resources/__files/hooks/.gitkeep

Whitespace-only changes.

src/test/resources/__files/hooks/post_hook_java_8.0.101_linuxx64.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/test/resources/__files/hooks/post_hook_java_8.0.111_linuxx64.sh

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/test/resources/__files/hooks/post_hook_java_8.0.111_universal.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/test/resources/__files/hooks/pre_hook_java_8.0.101_linuxx64.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/test/resources/__files/hooks/pre_hook_java_8.0.111_linuxx64.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)