diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 660823e3..393f9e30 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,14 +30,8 @@ jobs: - ubuntu-2204 - ubuntu-2004 suite: - # - openjdk-11 # Debian doesn't have an 11 package - openjdk-16 - openjdk-17 - # - temurin-8-hotspot - # - temurin-11-hotspot - # - semeru-11-openj9 - # - semeru-17-openj9 - - corretto-8 - corretto-11 - corretto-17 - corretto-18 diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 00000000..58f0386e --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +ruby system diff --git a/CHANGELOG.md b/CHANGELOG.md index 1caecfe8..8e88958b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ This file is used to list changes made in each version of the Java cookbook. ## Unreleased +- Update Temurin support +- Add script to check for Java updates +- Remove Java 8 support + ## 12.1.1 - *2024-12-05* ## 12.1.0 - *2024-12-03* diff --git a/bin/check_java_versions.rb b/bin/check_java_versions.rb new file mode 100755 index 00000000..bb6336ea --- /dev/null +++ b/bin/check_java_versions.rb @@ -0,0 +1,96 @@ +#!/usr/bin/env ruby + +require 'net/http' +require 'json' +require 'uri' + +TEMURIN_REPOS = { + '11' => 'adoptium/temurin11-binaries', + '17' => 'adoptium/temurin17-binaries', +}.freeze + +SEMERU_REPOS = { + '11' => 'ibmruntimes/semeru11-binaries', + '17' => 'ibmruntimes/semeru17-binaries', +}.freeze + +CORRETTO_REPOS = { + '11' => 'corretto-11', + '17' => 'corretto-17', +}.freeze + +def get_latest_release(repo) + uri = URI("https://api.github.com/repos/#{repo}/releases/latest") + response = Net::HTTP.get_response(uri) + + if response.is_a?(Net::HTTPSuccess) + JSON.parse(response.body) + else + puts "Failed to fetch release info for #{repo}: #{response.code} #{response.message}" + nil + end +end + +def verify_url(url) + uri = URI(url) + response = Net::HTTP.get_response(uri) + + case response + when Net::HTTPRedirection + location = response['location'] + puts " ✓ URL redirects successfully to: #{location}" + true + when Net::HTTPSuccess + puts ' ✓ URL is directly accessible' + true + else + puts " ✗ URL is not accessible: #{response.code} #{response.message}" + false + end +end + +def find_linux_x64_jdk(assets) + assets.find { |asset| asset['name'] =~ /OpenJDK\d+U-jdk_x64_linux_hotspot.*\.tar\.gz$/ } +end + +def check_versions + puts 'Checking Temurin versions...' + puts '-' * 50 + + TEMURIN_REPOS.each do |version, repo| + puts "\nChecking Java #{version}..." + release = get_latest_release(repo) + next unless release + + tag = release['tag_name'] + puts "Latest release: #{tag}" + + asset = find_linux_x64_jdk(release['assets']) + if asset + url = asset['browser_download_url'] + puts "Download URL: #{url}" + if verify_url(url) + puts 'Current version in cookbook needs updating!' if url != current_url_in_cookbook(version) + end + else + puts ' ✗ No Linux x64 JDK found in release assets' + end + end +end + +def current_url_in_cookbook(version) + # Read the current URLs from openjdk_helpers.rb + helpers_file = File.join(File.dirname(__FILE__), '..', 'libraries', 'openjdk_helpers.rb') + content = File.read(helpers_file) + + case version + when '11' + content.match(/temurin.*when '11'\s+'(.+?)'/m)&.[](1) + when '17' + content.match(/temurin.*when '17'\s+'(.+?)'/m)&.[](1) + end +end + +if __FILE__ == $PROGRAM_NAME + check_versions +end diff --git a/kitchen.yml b/kitchen.yml index b8771bba..71798c7f 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -48,16 +48,6 @@ suites: inputs: { java_version: "17" } # Temurin/Semeru - - name: temurin-8-hotspot - run_list: - - recipe[test::openjdk] - attributes: - version: 8 - variant: hotspot - verifier: - inspec_tests: [test/integration/openjdk] - inputs: { java_version: "8" } - - name: temurin-11-hotspot run_list: - recipe[test::openjdk] @@ -88,14 +78,29 @@ suites: inspec_tests: [test/integration/openjdk] inputs: { java_version: "17" } - # Corretto - - name: corretto-8 + - name: temurin-11 run_list: - - recipe[test::corretto] - attributes: { version: "8" } + - recipe[test::openjdk] + attributes: + java: + version: "11" + flavor: "temurin" verifier: - inspec_tests: [test/integration/corretto] - inputs: { java_version: "8" } + inspec_tests: [test/integration/openjdk] + inputs: { java_version: "11" } + + - name: temurin-17 + run_list: + - recipe[test::openjdk] + attributes: + java: + version: "17" + flavor: "temurin" + verifier: + inspec_tests: [test/integration/openjdk] + inputs: { java_version: "17" } + + # Corretto - name: corretto-11 run_list: - recipe[test::corretto] diff --git a/libraries/certificate_helpers.rb b/libraries/certificate_helpers.rb index 6dad63e6..3425fc76 100644 --- a/libraries/certificate_helpers.rb +++ b/libraries/certificate_helpers.rb @@ -5,16 +5,13 @@ def default_truststore_path(version, java_home) if version.to_i > 8 "#{java_home}/lib/security/cacerts" else - "#{java_home}/jre/lib/security/cacerts" + Chef::Log.fatal('Java 8 is no longer supported') + raise 'Java 8 is no longer supported' end end - def keystore_argument(version, cacerts, truststore_path) - if version.to_i > 8 && cacerts - '-cacerts' - else - "-keystore #{truststore_path}" - end + def keystore_argument(cacerts, truststore_path) + cacerts ? '-cacerts' : "-keystore #{truststore_path}" end end end diff --git a/libraries/corretto_helpers.rb b/libraries/corretto_helpers.rb index 350e5f54..0d6a8b38 100644 --- a/libraries/corretto_helpers.rb +++ b/libraries/corretto_helpers.rb @@ -7,8 +7,6 @@ def corretto_arch def default_corretto_bin_cmds(version) case version.to_s - when '8' - %w(appletviewer clhsdb extcheck hsdb idlj jar jarsigner java java-rmi.cgi javac javadoc javafxpackager javah javap javapackager jcmd jconsole jdb jdeps jfr jhat jinfo jjs jmap jps jrunscript jsadebugd jstack jstat jstatd keytool native2ascii orbd pack200 policytool rmic rmid rmiregistry schemagen serialver servertool tnameserv unpack200 wsgen wsimport xjc) when '11' %w(jaotc jar jarsigner java javac javadoc javap jcmd jconsole jdb jdeprscan jdeps jfr jhsdb jimage jinfo jjs jlink jmap jmod jps jrunscript jshell jstack jstat jstatd keytool pack200 rmic rmid rmiregistry serialver unpack200) when '15', '17', '18' @@ -20,8 +18,6 @@ def default_corretto_bin_cmds(version) def default_corretto_minor(version) case version - when '8' - '8.332.08.1' when '11' '11.0.15.9.1' when '17' diff --git a/libraries/openjdk_helpers.rb b/libraries/openjdk_helpers.rb index 362e1d52..1e5321f9 100644 --- a/libraries/openjdk_helpers.rb +++ b/libraries/openjdk_helpers.rb @@ -34,71 +34,58 @@ def default_openjdk_install_method(version) end end - def default_openjdk_url(version, variant = nil) - # Always default to OpenJDK - # If the user passes variant we'll also select that variant's URL - case version - when '8' - case variant - when 'semeru' - 'https://github.com/ibmruntimes/semeru8-binaries/releases/download/jdk8u322-b06_openj9-0.30.0/ibm-semeru-open-jdk_x64_linux_8u322b06_openj9-0.30.0.tar.gz' - when 'temurin' - 'https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u322-b06/OpenJDK8U-jdk_x64_linux_hotspot_8u322b06.tar.gz' + def default_openjdk_url(version, variant = 'openjdk') + case variant.downcase + when 'temurin' + case version + when '11' + 'https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.25%2B9/OpenJDK11U-jdk_x64_linux_hotspot_11.0.25_9.tar.gz' + when '17' + 'https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.13%2B11/OpenJDK17U-jdk_x64_linux_hotspot_17.0.13_11.tar.gz' else Chef::Log.fatal('Version specified does not have a URL value set') raise 'Version supplied does not have a download URL set' end - when '9' - 'https://download.java.net/java/GA/jdk9/9/binaries/openjdk-9_linux-x64_bin.tar.gz' - when '10' - 'https://download.java.net/java/GA/jdk10/10/binaries/openjdk-10_linux-x64_bin.tar.gz' - when '11' - case variant - when 'semeru' + when 'semeru' + case version + when '11' 'https://github.com/ibmruntimes/semeru11-binaries/releases/download/jdk-11.0.14.1%2B1_openj9-0.30.1/ibm-semeru-open-jdk_x64_linux_11.0.14.1_1_openj9-0.30.1.tar.gz' - when 'temurin' - 'https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15%2B10/OpenJDK11U-jdk_x64_linux_hotspot_11.0.15_10.tar.gz' - else - 'https://download.java.net/java/ga/jdk11/openjdk-11_linux-x64_bin.tar.gz' - end - when '12' - 'https://download.java.net/java/GA/jdk12/33/GPL/openjdk-12_linux-x64_bin.tar.gz' - when '13' - 'https://download.java.net/java/GA/jdk13/5b8a42f3905b406298b72d750b6919f6/33/GPL/openjdk-13_linux-x64_bin.tar.gz' - when '14' - 'https://download.java.net/java/GA/jdk14/076bab302c7b4508975440c56f6cc26a/36/GPL/openjdk-14_linux-x64_bin.tar.gz' - when '15' - 'https://download.java.net/java/GA/jdk15/779bf45e88a44cbd9ea6621d33e33db1/36/GPL/openjdk-15_linux-x64_bin.tar.gz' - when '16' - case variant - when 'semeru' + when '16' 'https://github.com/ibmruntimes/semeru16-binaries/releases/download/jdk-16.0.2%2B7_openj9-0.27.1/ibm-semeru-open-jdk_ppc64le_linux_16.0.2_7_openj9-0.27.1.tar.gz' - when 'temurin' - 'https://github.com/adoptium/temurin16-binaries/releases/download/jdk-16.0.2%2B7/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz' - else - 'https://download.java.net/java/GA/jdk16/7863447f0ab643c585b9bdebf67c69db/36/GPL/openjdk-16_linux-x64_bin.tar.gz' - end - when '17' - case variant - when 'semeru' + when '17' 'https://github.com/ibmruntimes/semeru17-binaries/releases/download/jdk-17.0.2%2B8_openj9-0.30.0/ibm-semeru-open-jdk_x64_linux_17.0.2_8_openj9-0.30.0.tar.gz' - when 'temurin' - 'https://github.com/adoptium/temurin18-binaries/releases/download/jdk-18.0.1%2B10/OpenJDK18U-jdk_x64_linux_hotspot_18.0.1_10.tar.gz' - else - 'https://download.java.net/java/GA/jdk17/0d483333a00540d886896bac774ff48b/35/GPL/openjdk-17_linux-x64_bin.tar.gz' - end - when '18' - case variant - when 'semeru' + when '18' 'https://github.com/AdoptOpenJDK/semeru18-binaries/releases/download/jdk-18.0.1%2B10_openj9-0.32.0/ibm-semeru-open-jdk_x64_linux_18.0.1_10_openj9-0.32.0.tar.gz' - when 'temurin' - 'https://github.com/adoptium/temurin18-binaries/releases/download/jdk-18.0.1%2B10/OpenJDK18U-jdk_x64_linux_hotspot_18.0.1_10.tar.gz' else - 'https://download.java.net/java/GA/jdk18.0.1/3f48cabb83014f9fab465e280ccf630b/10/GPL/openjdk-18.0.1_linux-x64_bin.tar.gz' + Chef::Log.fatal('Version specified does not have a URL value set') + raise 'Version supplied does not have a download URL set' end else - Chef::Log.fatal('Version specified does not have a URL value set') - raise 'Version supplied does not have a download URL set' + case version + when '9' + 'https://download.java.net/java/GA/jdk9/9/binaries/openjdk-9_linux-x64_bin.tar.gz' + when '10' + 'https://download.java.net/java/GA/jdk10/10/binaries/openjdk-10_linux-x64_bin.tar.gz' + when '11' + 'https://download.java.net/java/ga/jdk11/openjdk-11_linux-x64_bin.tar.gz' + when '12' + 'https://download.java.net/java/GA/jdk12/33/GPL/openjdk-12_linux-x64_bin.tar.gz' + when '13' + 'https://download.java.net/java/GA/jdk13/5b8a42f3905b406298b72d750b6919f6/33/GPL/openjdk-13_linux-x64_bin.tar.gz' + when '14' + 'https://download.java.net/java/GA/jdk14/076bab302c7b4508975440c56f6cc26a/36/GPL/openjdk-14_linux-x64_bin.tar.gz' + when '15' + 'https://download.java.net/java/GA/jdk15/779bf45e88a44cbd9ea6621d33e33db1/36/GPL/openjdk-15_linux-x64_bin.tar.gz' + when '16' + 'https://download.java.net/java/GA/jdk16/7863447f0ab643c585b9bdebf67c69db/36/GPL/openjdk-16_linux-x64_bin.tar.gz' + when '17' + 'https://download.java.net/java/GA/jdk17/0d483333a00540d886896bac774ff48b/35/GPL/openjdk-17_linux-x64_bin.tar.gz' + when '18' + 'https://download.java.net/java/GA/jdk18.0.1/3f48cabb83014f9fab465e280ccf630b/10/GPL/openjdk-18.0.1_linux-x64_bin.tar.gz' + else + Chef::Log.fatal('Version specified does not have a URL value set') + raise 'Version supplied does not have a download URL set' + end end end @@ -130,10 +117,6 @@ def default_openjdk_checksum(version) def default_openjdk_bin_cmds(version) case version - when '7' - %w(appletviewer apt ControlPanel extcheck idlj jar jarsigner java javac javadoc javafxpackager javah javap javaws jcmd jconsole jcontrol jdb jdeps jhat jinfo jjs jmap jmc jps jrunscript jsadebugd jstack jstat jstatd jvisualvm keytool native2ascii orbd pack200 policytool rmic rmid rmiregistry schemagen serialver servertool tnameserv unpack200 wsgen wsimport xjc) - when '8' - %w(appletviewer apt ControlPanel extcheck idlj jar jarsigner java javac javadoc javafxpackager javah javap javaws jcmd jconsole jcontrol jdb jdeps jhat jinfo jjs jmap jmc jps jrunscript jsadebugd jstack jstat jstatd jvisualvm keytool native2ascii orbd pack200 policytool rmic rmid rmiregistry schemagen serialver servertool tnameserv unpack200 wsgen wsimport xjc) when '9' %w(appletviewer idlj jaotc jar jarsigner java javac javadoc javah javap jcmd jconsole jdb jdeprscan jdeps jhsdb jimage jinfo jjs jlink jmap jmod jps jrunscript jshell jstack jstat jstatd keytool orbd pack200 policytool rmic rmid rmiregistry schemagen serialver servertool tnameserv unpack200 wsgen wsimport xjc) when '10' diff --git a/resources/certificate.rb b/resources/certificate.rb index 1c5286fe..62053219 100644 --- a/resources/certificate.rb +++ b/resources/certificate.rb @@ -56,7 +56,7 @@ action :install do require 'openssl' - keystore_argument = keystore_argument(new_resource.java_version, new_resource.cacerts, new_resource.keystore_path) + keystore_argument = keystore_argument(new_resource.cacerts, new_resource.keystore_path) certdata = new_resource.cert_data || fetch_certdata @@ -107,7 +107,7 @@ end action :remove do - keystore_argument = keystore_argument(new_resource.java_version, new_resource.cacerts, new_resource.keystore_path) + keystore_argument = keystore_argument(new_resource.cacerts, new_resource.keystore_path) cmd = Mixlib::ShellOut.new("#{new_resource.java_home}/bin/keytool -list #{keystore_argument} -storepass #{new_resource.keystore_passwd} -v | grep \"#{new_resource.cert_alias}\"") cmd.run_command diff --git a/spec/libraries/certificate_helpers_spec.rb b/spec/libraries/certificate_helpers_spec.rb index 926f8f3e..59fd240f 100644 --- a/spec/libraries/certificate_helpers_spec.rb +++ b/spec/libraries/certificate_helpers_spec.rb @@ -8,15 +8,6 @@ class DummyClass < Chef::Node subject { DummyClass.new } describe '#default_truststore_path' do - context 'Java 8' do - let(:version) { '8' } - let(:java_home) { '/usr/lib/jvm/corretto-8' } - - it 'returns the correct path' do - expect(subject.default_truststore_path(version, java_home)).to eq('/usr/lib/jvm/corretto-8/jre/lib/security/cacerts') - end - end - context 'Java 9' do let(:version) { '9' } let(:java_home) { '/usr/lib/jvm/corretto-9' } @@ -28,33 +19,21 @@ class DummyClass < Chef::Node end describe '#keystore_argument' do - context 'Java 8 and cacerts' do - let(:version) { '8' } - let(:cacerts) { true } - let(:truststore_path) { '/usr/lib/jvm/corretto-8/jre/lib/security/cacerts' } - - it 'returns the correct argument' do - expect(subject.keystore_argument(version, cacerts, truststore_path)).to eq('-keystore /usr/lib/jvm/corretto-8/jre/lib/security/cacerts') - end - end - - context 'Java 9 and cacerts' do - let(:version) { '9' } + context 'cacerts set ' do let(:cacerts) { true } let(:truststore_path) { '/usr/lib/jvm/corretto-9/jre/lib/security/cacerts' } it 'returns the correct argument' do - expect(subject.keystore_argument(version, cacerts, truststore_path)).to eq('-cacerts') + expect(subject.keystore_argument(cacerts, truststore_path)).to eq('-cacerts') end end - context 'Java 9 and no cacerts' do - let(:version) { '9' } + context 'no cacerts' do let(:cacerts) { false } let(:truststore_path) { '/mycertstore.jks' } it 'returns the correct argument' do - expect(subject.keystore_argument(version, cacerts, truststore_path)).to eq('-keystore /mycertstore.jks') + expect(subject.keystore_argument(cacerts, truststore_path)).to eq('-keystore /mycertstore.jks') end end end diff --git a/spec/libraries/corretto_helpers_spec.rb b/spec/libraries/corretto_helpers_spec.rb index c7239dad..152f7077 100644 --- a/spec/libraries/corretto_helpers_spec.rb +++ b/spec/libraries/corretto_helpers_spec.rb @@ -13,15 +13,6 @@ class DummyClass < Chef::Node allow(subject).to receive(:[]).with('kernel').and_return('machine' => machine) end - context 'Corretto 8 x64' do - let(:version) { '8' } - let(:machine) { 'x86_64' } - - it 'returns the correct URL' do - expect(subject.default_corretto_url(version)).to match /corretto-8.+\.tar.gz/ - end - end - context 'Corretto 11 x64' do let(:version) { '11' } let(:machine) { 'x86_64' } @@ -49,15 +40,6 @@ class DummyClass < Chef::Node end end - context 'Corretto 8 aarch64' do - let(:version) { '8' } - let(:machine) { 'aarch64' } - - it 'returns the correct URL' do - expect(subject.default_corretto_url(version)).to match /corretto-8.+\.tar.gz/ - end - end - context 'Corretto 11 aarch64' do let(:version) { '11' } let(:machine) { 'aarch64' } @@ -91,15 +73,6 @@ class DummyClass < Chef::Node allow(subject).to receive(:[]).with('version').and_return(version) end - context 'Corretto 8' do - let(:version) { '8' } - - it 'returns the correct bin command array' do - expect(subject.default_corretto_bin_cmds(version)).to include 'appletviewer' - expect(subject.default_corretto_bin_cmds(version)).to_not include 'jaotc' - end - end - context 'Corretto 11' do let(:version) { '11' } @@ -133,24 +106,6 @@ class DummyClass < Chef::Node allow(subject).to receive(:[]).with('kernel').and_return('machine' => machine) end - context 'No full_version passed for Corretto 8 x64' do - let(:version) { '8' } - let(:machine) { 'x86_64' } - - it 'returns the default directory value for Corrretto 8 x64' do - expect(subject.corretto_sub_dir(version)).to include '8.332.08.1' - end - end - - context 'No full_version passed for Corretto 8 aarch64' do - let(:version) { '8' } - let(:machine) { 'aarch64' } - - it 'returns the default directory value for Corrretto 8 aarch64' do - expect(subject.corretto_sub_dir(version)).to include '8.332.08.1' - end - end - context 'No full_version passed for Corretto 11 x64' do let(:version) { '11' } let(:machine) { 'x86_64' } @@ -204,26 +159,6 @@ class DummyClass < Chef::Node expect(subject.corretto_sub_dir(version)).to include '18.0.1.10.1' end end - - context 'A full version passed for for Corretto 8 x64' do - let(:version) { '8' } - let(:full_version) { '8.123.45.6' } - let(:machine) { 'x86_64' } - - it 'returns the default directory value for Corrretto 8 x64' do - expect(subject.corretto_sub_dir(version, full_version)).to include '8.123.45.6' - end - end - - context 'A full version passed for for Corretto 8 aarch64' do - let(:version) { '8' } - let(:full_version) { '8.123.45.6' } - let(:machine) { 'aarch64' } - - it 'returns the default directory value for Corrretto 8 aarch64' do - expect(subject.corretto_sub_dir(version, full_version)).to include '8.123.45.6' - end - end end end end diff --git a/spec/libraries/openjdk_helpers_spec.rb b/spec/libraries/openjdk_helpers_spec.rb index f57d4724..e541ffdf 100644 --- a/spec/libraries/openjdk_helpers_spec.rb +++ b/spec/libraries/openjdk_helpers_spec.rb @@ -34,6 +34,20 @@ class DummyClass < Chef::Node .to raise_error('Version supplied does not have a download URL set') end end + + context 'Temurin' do + let(:version) { '17' } + + it 'returns the correct download URL for Temurin' do + expect(subject.default_openjdk_url(version, 'temurin')) + .to eq 'https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.13%2B11/OpenJDK17U-jdk_x64_linux_hotspot_17.0.13_11.tar.gz' + end + + it 'returns the correct download URL for Temurin 11' do + expect(subject.default_openjdk_url('11', 'temurin')) + .to eq 'https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.25%2B9/OpenJDK11U-jdk_x64_linux_hotspot_11.0.25_9.tar.gz' + end + end end describe '#default_openjdk_install_method' do diff --git a/spec/libraries/semeru_helpers_spec.rb b/spec/libraries/semeru_helpers_spec.rb index 8910a555..c608a783 100644 --- a/spec/libraries/semeru_helpers_spec.rb +++ b/spec/libraries/semeru_helpers_spec.rb @@ -12,11 +12,11 @@ class DummyClass < Chef::Node allow(subject).to receive(:[]).with('url').and_return(url) end - context 'OpenJDK Semeru 8' do - let(:url) { 'https://github.com/ibmruntimes/semeru8-binaries/releases/download/jdk8u322-b06_openj9-0.30.0/ibm-semeru-open-jdk_x64_linux_8u322b06_openj9-0.30.0.tar.gz' } + context 'OpenJDK Semeru 17' do + let(:url) { 'https://github.com/ibmruntimes/semeru17-binaries/releases/download/jdk-17.0.2%2B8_openj9-0.30.0/ibm-semeru-open-jdk_x64_linux_17.0.2_8_openj9-0.30.0.tar.gz' } it 'returns the correct folder name' do - expect(subject.sub_dir(url)).to eq 'jdk8u322-b06' + expect(subject.sub_dir(url)).to eq 'jdk-17.0.2-b8' end end @@ -34,15 +34,6 @@ class DummyClass < Chef::Node allow(subject).to receive(:[]).with('version').and_return(version) end - context 'Semeru 8' do - let(:version) { '8' } - let(:variant) { 'semeru' } - - it 'returns the correct URL' do - expect(subject.default_openjdk_url(version, variant)).to eq 'https://github.com/ibmruntimes/semeru8-binaries/releases/download/jdk8u322-b06_openj9-0.30.0/ibm-semeru-open-jdk_x64_linux_8u322b06_openj9-0.30.0.tar.gz' - end - end - context 'Semeru 11' do let(:version) { '11' } let(:variant) { 'semeru' }