From ba6204adc313660f7b64a835c69b0d973c02e735 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 24 Feb 2021 03:14:53 -0500 Subject: [PATCH] withBasicApiToken should create the user as needed (#273) --- src/main/java/org/jvnet/hudson/test/JenkinsRule.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/org/jvnet/hudson/test/JenkinsRule.java b/src/main/java/org/jvnet/hudson/test/JenkinsRule.java index f376722dc..bf80fb505 100644 --- a/src/main/java/org/jvnet/hudson/test/JenkinsRule.java +++ b/src/main/java/org/jvnet/hudson/test/JenkinsRule.java @@ -2724,8 +2724,7 @@ public URL createCrumbedUrl(String relativePath) throws IOException { * @since 2.32 */ public @Nonnull WebClient withBasicApiToken(@Nonnull String userId){ - User user = User.getById(userId, false); - assertNotNull("The userId must correspond to an already created User", user); + User user = User.getById(userId, true); return withBasicApiToken(user); }