Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-71803

Blue Ocean tests fail on Java 21 with Mockito errors

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • blueocean-plugin
    • None
    • 1.27.7

      The following Blue Ocean tests fail on Java 21 with Mockito errors:

      io.jenkins.blueocean.blueocean_github_pipeline.GithubEnterpriseScmContentProviderTest
      io.jenkins.blueocean.blueocean_github_pipeline.GithubIssueTest
      io.jenkins.blueocean.blueocean_github_pipeline.GithubOrganizationFolderTest
      io.jenkins.blueocean.blueocean_github_pipeline.GithubPipelineCreateRequestTest
      io.jenkins.blueocean.blueocean_github_pipeline.GithubScmContentProviderTest
      io.jenkins.blueocean.blueocean_github_pipeline.GithubScmTest
      io.jenkins.blueocean.rest.impl.pipeline.BranchMetadataTest
      io.jenkins.blueocean.rest.impl.pipeline.CachesTest
      io.jenkins.blueocean.rest.impl.pipeline.credential.BlueOceanCredentialsProviderTest
      io.jenkins.blueocean.rest.impl.pipeline.OrganizationFolderTest
      io.jenkins.blueocean.rest.impl.pipeline.PipelineNodeImplTest
      io.jenkins.blueocean.service.embedded.BlueTestResultContainerImplTest
      io.jenkins.blueocean.service.embedded.BlueTestResultFactoryTest
      io.jenkins.blueocean.service.embedded.ChangeSetResourceTest
      io.jenkins.blueocean.service.embedded.rest.BlueJUnitTestResultTest
      io.jenkins.blueocean.service.embedded.rest.DefaultRunImplTest
      io.jenkins.blueocean.service.embedded.rest.FreeStylePipelineTest
      io.jenkins.blueocean.service.embedded.rest.UserImplPermissionTest
      

          [JENKINS-71803] Blue Ocean tests fail on Java 21 with Mockito errors

          Basil Crow added a comment -

          olamy Similar issues have been observed in other plugins and were resolved by updating the plugin parent POM to 4.68 which has a recent version of Mockito that supports Java 21. Can this plugin be upgraded to a recent version of Mockito and a new version released for BOM/PCT purposes?

          Basil Crow added a comment - olamy Similar issues have been observed in other plugins and were resolved by updating the plugin parent POM to 4.68 which has a recent version of Mockito that supports Java 21. Can this plugin be upgraded to a recent version of Mockito and a new version released for BOM/PCT purposes?

          Basil Crow added a comment -

          When this ticket is resolved, the workaround in jenkinsci/bom should be deleted per https://github.com/jenkinsci/bom/issues/2381

          Basil Crow added a comment - When this ticket is resolved, the workaround in jenkinsci/bom should be deleted per https://github.com/jenkinsci/bom/issues/2381

          Basil Crow added a comment -

          Suggest the following patch:

          diff --git a/blueocean-bitbucket-pipeline/pom.xml b/blueocean-bitbucket-pipeline/pom.xml
          index ffd7b0e9c..0b2cae80c 100644
          --- a/blueocean-bitbucket-pipeline/pom.xml
          +++ b/blueocean-bitbucket-pipeline/pom.xml
          @@ -88,7 +88,7 @@
               <!-- end HttpRequest -->
               <dependency>
                 <groupId>org.mockito</groupId>
          -      <artifactId>mockito-inline</artifactId>
          +      <artifactId>mockito-core</artifactId>
                 <scope>test</scope>
               </dependency>
             </dependencies>
          diff --git a/blueocean-github-pipeline/pom.xml b/blueocean-github-pipeline/pom.xml
          index cc1558000..65204953c 100644
          --- a/blueocean-github-pipeline/pom.xml
          +++ b/blueocean-github-pipeline/pom.xml
          @@ -69,7 +69,7 @@
               </dependency>
               <dependency>
                 <groupId>org.mockito</groupId>
          -      <artifactId>mockito-inline</artifactId>
          +      <artifactId>mockito-core</artifactId>
                 <scope>test</scope>
               </dependency>
           
          diff --git a/pom.xml b/pom.xml
          index 0d24f1b4c..d15166528 100644
          --- a/pom.xml
          +++ b/pom.xml
          @@ -37,7 +37,6 @@
               <frontend-version>1.12.0</frontend-version>
               <node.version>10.13.0</node.version>
               <npm.version>6.14.4</npm.version>
          -    <mockito.version>4.7.0</mockito.version>
               <jacoco.version>0.8.6</jacoco.version>
               <jacoco.haltOnFailure>false</jacoco.haltOnFailure>
               <jacoco.line.coverage>0.70</jacoco.line.coverage>
          @@ -201,11 +200,6 @@
                     <artifactId>mockito-core</artifactId>
                     <scope>test</scope>
                 </dependency>
          -      <dependency>
          -          <groupId>org.mockito</groupId>
          -          <artifactId>mockito-inline</artifactId>
          -          <scope>test</scope>
          -      </dependency>
                 <dependency>
                     <groupId>com.mashape.unirest</groupId>
                     <artifactId>unirest-java</artifactId>
          @@ -499,16 +493,6 @@
                       <artifactId>byte-buddy-agent</artifactId>
                       <version>1.12.13</version>
                   </dependency>
          -        <dependency>
          -            <groupId>org.mockito</groupId>
          -            <artifactId>mockito-core</artifactId>
          -            <version>${mockito.version}</version>
          -        </dependency>
          -        <dependency>
          -            <groupId>org.mockito</groupId>
          -            <artifactId>mockito-inline</artifactId>
          -            <version>${mockito.version}</version>
          -        </dependency>
                   <!-- some tests need to  write final field -->
                   <dependency>
                       <groupId>org.powermock</groupId>
          

          Basil Crow added a comment - Suggest the following patch: diff --git a/blueocean-bitbucket-pipeline/pom.xml b/blueocean-bitbucket-pipeline/pom.xml index ffd7b0e9c..0b2cae80c 100644 --- a/blueocean-bitbucket-pipeline/pom.xml +++ b/blueocean-bitbucket-pipeline/pom.xml @@ -88,7 +88,7 @@ <!-- end HttpRequest --> <dependency> <groupId>org.mockito</groupId> - <artifactId>mockito-inline</artifactId> + <artifactId>mockito-core</artifactId> <scope>test</scope> </dependency> </dependencies> diff --git a/blueocean-github-pipeline/pom.xml b/blueocean-github-pipeline/pom.xml index cc1558000..65204953c 100644 --- a/blueocean-github-pipeline/pom.xml +++ b/blueocean-github-pipeline/pom.xml @@ -69,7 +69,7 @@ </dependency> <dependency> <groupId>org.mockito</groupId> - <artifactId>mockito-inline</artifactId> + <artifactId>mockito-core</artifactId> <scope>test</scope> </dependency> diff --git a/pom.xml b/pom.xml index 0d24f1b4c..d15166528 100644 --- a/pom.xml +++ b/pom.xml @@ -37,7 +37,6 @@ <frontend-version>1.12.0</frontend-version> <node.version>10.13.0</node.version> <npm.version>6.14.4</npm.version> - <mockito.version>4.7.0</mockito.version> <jacoco.version>0.8.6</jacoco.version> <jacoco.haltOnFailure>false</jacoco.haltOnFailure> <jacoco.line.coverage>0.70</jacoco.line.coverage> @@ -201,11 +200,6 @@ <artifactId>mockito-core</artifactId> <scope>test</scope> </dependency> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-inline</artifactId> - <scope>test</scope> - </dependency> <dependency> <groupId>com.mashape.unirest</groupId> <artifactId>unirest-java</artifactId> @@ -499,16 +493,6 @@ <artifactId>byte-buddy-agent</artifactId> <version>1.12.13</version> </dependency> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <version>${mockito.version}</version> - </dependency> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-inline</artifactId> - <version>${mockito.version}</version> - </dependency> <!-- some tests need to write final field --> <dependency> <groupId>org.powermock</groupId>

            basil Basil Crow
            basil Basil Crow
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: