Skip to content

Commit

Permalink
Fix test failure for JDK 21 CI build
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcono1234 committed Sep 7, 2024
1 parent e0114e9 commit c8606b9
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,12 @@ public void testExports() {

@Test
public void testRequireCapability() {
// When building with JDK >= 21, the minimum target version is Java 8
String expectedJavaVersion = Runtime.version().feature() < 21 ? "1.7" : "1.8";

// Defines the minimum required Java version
assertThat(getAttribute("Require-Capability"))
.isEqualTo("osgi.ee;filter:=\"(&(osgi.ee=JavaSE)(version=1.7))\"");
.isEqualTo("osgi.ee;filter:=\"(&(osgi.ee=JavaSE)(version=" + expectedJavaVersion + "))\"");

// Should not define deprecated "Bundle-RequiredExecutionEnvironment"
assertThat(getAttribute("Bundle-RequiredExecutionEnvironment")).isNull();
Expand Down

0 comments on commit c8606b9

Please sign in to comment.