Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up CI with JDK 18 #30104

Closed
wilkinsona opened this issue Mar 8, 2022 · 1 comment
Closed

Set up CI with JDK 18 #30104

wilkinsona opened this issue Mar 8, 2022 · 1 comment
Assignees
Labels
type: task A general task
Milestone

Comments

@wilkinsona
Copy link
Member

wilkinsona commented Mar 8, 2022

JDK 18 has reached its release candidate phase and will GA on 22 March. We should add CI for it to verify compatibility.

@wilkinsona wilkinsona added the type: task A general task label Mar 8, 2022
@wilkinsona wilkinsona added this to the 2.5.x milestone Mar 8, 2022
@wilkinsona wilkinsona self-assigned this Mar 8, 2022
@wilkinsona
Copy link
Member Author

wilkinsona commented Mar 8, 2022

Mockito's Answers.CALLS_REAL_METHODS doesn't work with JDK 18 when the real method is a default method on an interface that's being mocked. It fails like this:

org.mockito.exceptions.base.MockitoException: 
Cannot call abstract real method on java object!
Calling real methods is only possible when mocking non abstract method.
  //correct example:
  when(mockOfConcreteClass.nonAbstractMethod()).thenCallRealMethod();
	at org.springframework.boot.context.properties.source.AliasedConfigurationPropertySourceTests.containsDescendantOfWhenSourceReturnsUnknownShouldReturnUnknown(AliasedConfigurationPropertySourceTests.java:62)
	…

The problem only occurs in the 2.5.x branch where we're using Mockito 3.9.0. It doesn't occur in 2.6.x where we've upgraded to Mockito 4.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: task A general task
Projects
None yet
Development

No branches or pull requests

1 participant