From 6fdfc07513e3f89c769af33dfdae3ca66857a9df Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Thu, 5 Sep 2024 12:24:48 -0700 Subject: [PATCH] Forward compatibility with jenkinsci/jenkins#7268 (#389) --- src/test/java/org/jenkinsci/plugins/oic/PluginTest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/jenkinsci/plugins/oic/PluginTest.java b/src/test/java/org/jenkinsci/plugins/oic/PluginTest.java index 7a164f0d..85af5782 100644 --- a/src/test/java/org/jenkinsci/plugins/oic/PluginTest.java +++ b/src/test/java/org/jenkinsci/plugins/oic/PluginTest.java @@ -15,6 +15,7 @@ import edu.umd.cs.findbugs.annotations.Nullable; import hudson.model.User; import hudson.tasks.Mailer; +import hudson.util.VersionNumber; import java.io.IOException; import java.net.URI; import java.net.http.HttpClient; @@ -39,6 +40,7 @@ import jenkins.model.Jenkins; import jenkins.security.LastGrantedAuthoritiesProperty; import org.hamcrest.MatcherAssert; +import org.htmlunit.html.HtmlPage; import org.junit.Before; import org.junit.Ignore; import org.junit.Rule; @@ -776,7 +778,10 @@ public void testLastGrantedAuthoritiesProperty() throws Exception { 3, userProperty.getAuthorities2().size()); - jenkinsRule.submit(webClient.goTo("me/configure").getFormByName("config")); + HtmlPage configure = Jenkins.getVersion().isNewerThan(new VersionNumber("2.467")) + ? webClient.goTo("me/account/") + : webClient.goTo("me/configure"); + jenkinsRule.submit(configure.getFormByName("config")); user = User.getById(TEST_USER_USERNAME, false); assertEquals( "User should still be in 2 groups", 2, user.getAuthorities().size());