Skip to content

[java-pubsub] JDK 24 support and Mockito #13046

Open

Description

@diegomarquezp

Seeing a PublisherImplTest.testShutDown:1035 » IllegalArgument Could not create type error that seems related to this dependency update as the referenced line is related to mocking the Publisher.

@michaelpri10 Easymock 5.6.0 actually has the fix for this very error (updating byte-buddy) - see easymock/easymock#673

However this transitive byte-buddy version was not picked up because mockito is declared before easymock in google-cloud-pubsub/pom.xml.

Flipping the order of these two dependencies did the trick.

Edit: this solution is not ideal. Let's look into upgrading mockito as well, in case it brings a later version of byte-buddy.

Originally posted by @diegomarquezp in googleapis/java-pubsub#2069 (comment)

Activity

  1. added
    api: pubsub
    on Jun 17, 2025
  2. michaelpri10 commented on Jun 24, 2025

    @michaelpri10
    Contributor

    There is an open pull request for upgrading mockito at googleapis/java-pubsub#1882 that is currently failing with the error:

    org/mockito/ArgumentMatcher has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
    

    This seems be a version mismatch between Java 8 (52) and Java 11 (55) (per this StackOverflow). The issue is that Mockito v5 dropped support for Java 8.

    We may need to stick with this solution of the flipped easymock and mockito dependencies are can potentially look into removing the mockito dependency completely.

  3. added
    priority: p3
    on Sep 30, 2025
  4. michaelpri10 commented on Sep 30, 2025

    @michaelpri10
    Contributor

    We'll be supporting Java 8 until at least September 2026, per this documentation, so our options are likely to either:

    • Use the flipped dependency trick until Java 8 support is dropped
    • Refactor tests to no longer use the Mockito dependency
  5. changed the title [-]JDK 24 support and Mockito[/-] [+][java-pubsub] JDK 24 support and Mockito[/+] on May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: pubsubpriority: p3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions