@@ -4,16 +4,13 @@ import io.cucumber.datatable.DataTable
44import sdkman.support.UnixUtils
55
66import static cucumber.api.groovy.EN.And
7- import static sdkman.stubs.HookResponses.*
87import static sdkman.stubs.WebServiceStub.*
98import static sdkman.support.FilesystemUtils.readCurrentFromCandidateFolder
109import static sdkman.support.FilesystemUtils.readVersionsCsvFromCandidateFolder
1110
1211And (~' ^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
1916And (~' ^an available selfupdate$' ) { ->
@@ -24,28 +21,12 @@ And(~'^an available selfupdate$') { ->
2421And (~' ^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
3126And (~' ^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
5132And (~' ^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-
7142And (~/ ^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" )
0 commit comments