Repository navigation
Fix invalid method reference when compiling with JDK17 - #13621
Conversation
|
For reviewers: I'm not sure why compilation error with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Changes look ok, thanks for fixing it. I wish we could have a way to fix the root cause / ensure that it doesn't fail in the future with similar thing. But that's outside of the scope of this.
|
I think this would work as well: @@ -178,8 +178,7 @@ public class OfflineSessionPersistenceTest extends KeycloakModelTest {
int numClients = 2;
List<String> clientIds = withRealm(realmId, (session, realm) -> {
return IntStream.range(0, numClients)
- .mapToObj(cid -> session.clients().addClient(realm, "client-" + cid))
- .map(ClientModel::getId)
+ .mapToObj(cid -> session.clients().addClient(realm, "client-" + cid).getId())
.collect(Collectors.toList());
});
@@ -236,8 +235,7 @@ public class OfflineSessionPersistenceTest extends KeycloakModelTest {
public void testPersistenceMultipleNodesClientSessionsAtRandomNode() throws InterruptedException {
List<String> clientIds = withRealm(realmId, (session, realm) -> {
return IntStream.range(0, 5)
- .mapToObj(cid -> session.clients().addClient(realm, "client-" + cid))
- .map(ClientModel::getId)
+ .mapToObj(cid -> session.clients().addClient(realm, "client-" + cid).getId())
.collect(Collectors.toList());
});
List<String> offlineSessionIds = createOfflineSessions(realmId, userIds);as well as this @@ -179,7 +179,7 @@ public class OfflineSessionPersistenceTest extends KeycloakModelTest {
List<String> clientIds = withRealm(realmId, (session, realm) -> {
return IntStream.range(0, numClients)
.mapToObj(cid -> session.clients().addClient(realm, "client-" + cid))
- .map(ClientModel::getId)
+ .map(x -> x.getId())
.collect(Collectors.toList());
});
@@ -237,7 +237,7 @@ public class OfflineSessionPersistenceTest extends KeycloakModelTest {
List<String> clientIds = withRealm(realmId, (session, realm) -> {
return IntStream.range(0, 5)
.mapToObj(cid -> session.clients().addClient(realm, "client-" + cid))
- .map(ClientModel::getId)
+ .map(x -> x.getId())
.collect(Collectors.toList());
});
List<String> offlineSessionIds = createOfflineSessions(realmId, userIds); |
|
@ahus1 Thanks for the additional review. At some point, there is a plan to have testsuite running in the pipeline with JDK 17 (maybe even with GH actions). So at that point, we will be sure that JDK 17 does not break. But AFAIK we're not there yet as you pointed |
This PR fixes compilation error during build of
testsuite/model/src/test/java/org/keycloak/testsuite/model/session/on JDK17 (17.0.4 temurin):Updates #8889