@@ -605,6 +605,7 @@ var _ = Describe("Supply", func() {
605605
606606 Context ("app/.jdk does not exist" , func () {
607607 BeforeEach (func () {
608+ mockManifest .EXPECT ().AllDependencyVersions ("openjdk" ).Return ([]string {})
608609 mockInstaller .EXPECT ().InstallOnlyVersion ("openjdk1.8-latest" , gomock .Any ()).Do (func (_ , path string ) error {
609610 Expect (os .MkdirAll (filepath .Join (path , "bin" ), 0755 )).To (Succeed ())
610611 Expect (os .WriteFile (filepath .Join (path , "bin" , "java" ), []byte ("java.exe" ), 0755 )).To (Succeed ())
@@ -625,6 +626,24 @@ var _ = Describe("Supply", func() {
625626 Expect (string (body )).To (ContainSubstring (`export JAVA_MEM=${JAVA_MEM:--Xmx${JVM_MAX_HEAP:-384}m}` ))
626627 })
627628 })
629+
630+ Context ("app/.jdk does not exist and openjdk (new naming) is available" , func () {
631+ BeforeEach (func () {
632+ // Override the global AllDependencyVersions("openjdk") mock for this context
633+ mockManifest .EXPECT ().AllDependencyVersions ("openjdk" ).Return ([]string {"17.0.13" }).AnyTimes ()
634+ mockInstaller .EXPECT ().InstallOnlyVersionWithStrip ("openjdk" , gomock .Any (), 1 ).Do (func (_ , path string , _ int ) error {
635+ Expect (os .MkdirAll (filepath .Join (path , "bin" ), 0755 )).To (Succeed ())
636+ Expect (os .WriteFile (filepath .Join (path , "bin" , "java" ), []byte ("java.exe" ), 0755 )).To (Succeed ())
637+ return nil
638+ })
639+ })
640+
641+ It ("installs and links the JDK using new openjdk naming (cflinuxfs5)" , func () {
642+ Expect (supplier .InstallJVM ()).To (Succeed ())
643+ Expect (filepath .Join (depsDir , depsIdx , "jvm" , "bin" , "java" )).To (BeAnExistingFile ())
644+ Expect (filepath .Join (depsDir , depsIdx , "bin" , "java" )).To (BeAnExistingFile ())
645+ })
646+ })
628647 })
629648
630649 Describe ("EnableLDLibraryPathEnv" , func () {
0 commit comments