Skip to content

Commit 4b8e01b

Browse files
authored
[JENKINS-75772] Support user API Token for Bitbucket Cloud (#1081)
Add a new bitbucket authenticator for user API token as replacement for the deprecated App Password. It requires to use different username when perform clone git and authenticate BitubcketAPIs.
1 parent 212a10e commit 4b8e01b

27 files changed

+344
-32
lines changed

docs/USER_GUIDE.adoc

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ If you want be able to perform git push operation from CLI than you have to setu
192192

193193
image::images/screenshot-17.png[]
194194

195-
=== App Passwords (Bitbucket Cloud only)
195+
=== App Passwords - DEPRECATED (Bitbucket Cloud only)
196196

197197
Bitbucket https://community.atlassian.com/t5/Bitbucket-articles/Announcement-Bitbucket-Cloud-account-password-usage-for-Git-over/ba-p/1948231[deprecated usage of Atlassian account password] for Bitbucket API and Git over HTTPS starting from March 1st, 2022.
198198

@@ -203,6 +203,21 @@ First, create a new _app password_ in Bitbucket as instructed in the https://sup
203203
Then create a new _Username with password credentials_ in Jenkins, enter the Bitbucket username (not the email) in the _Username_ field and the created app password in the _Password_ field.
204204

205205
IMPORTANT: App passwords do not support email address as a username for authentication. Using the email address will raise an authentication error in scanning/checkout process.
206+
The app passoword authentication has been deprecated by Atlassian and starting from September 9th, 2025 will not longer available for creation. https://www.atlassian.com/blog/bitbucket/bitbucket-cloud-transitions-to-api-tokens-enhancing-security-with-app-password-deprecation[Read here] for more informations.
207+
208+
=== User API Token (Bitbucket Cloud only)
209+
210+
Bitbucket https://www.atlassian.com/blog/bitbucket/bitbucket-cloud-transitions-to-api-tokens-enhancing-security-with-app-password-deprecation[deprecated usage of Atlassian App Password] for Bitbucket API and Git over HTTPS starting from September 9th, 2025.
211+
212+
The plugin can make use of an user API token with scopes instead of the app password.
213+
214+
First, create a new _User API token_ in Bitbucket as instructed in the https://support.atlassian.com/bitbucket-cloud/docs/create-an-api-token/[Bitbucket API Token Documentation]. At least allow _read_ access for project, repositories and pull requests. Also, you may need to allow _read_ and _write_ access for webhooks depending on your pipeline's triggers.
215+
216+
image::images/screenshot-22.png[]
217+
218+
Then create a new _Username with password credentials_ in Jenkins, enter the Atlassian Account email (not the username) in the _Username_ field and the created API token in the _Password_ field.
219+
220+
IMPORTANT: API token requires the email address as a username to authenticate using the BitbucketAPIs. Using the username will raise an authentication error in scanning/checkout process. API token without scope does not work.
206221

207222
=== OAuth credentials (Bitbucket Cloud only)
208223

docs/images/screenshot-22.png

30.5 KB
Loading

src/main/java/com/cloudbees/jenkins/plugins/bitbucket/client/BitbucketCloudApiClient.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import com.cloudbees.jenkins.plugins.bitbucket.impl.client.ICheckedCallable;
4848
import com.cloudbees.jenkins.plugins.bitbucket.impl.credentials.BitbucketAccessTokenAuthenticator;
4949
import com.cloudbees.jenkins.plugins.bitbucket.impl.credentials.BitbucketOAuthAuthenticator;
50+
import com.cloudbees.jenkins.plugins.bitbucket.impl.credentials.BitbucketUserAPITokenAuthenticator;
5051
import com.cloudbees.jenkins.plugins.bitbucket.impl.credentials.BitbucketUsernamePasswordAuthenticator;
5152
import com.cloudbees.jenkins.plugins.bitbucket.impl.util.BitbucketApiUtils;
5253
import com.cloudbees.jenkins.plugins.bitbucket.impl.util.JsonParser;
@@ -147,6 +148,7 @@ protected boolean isSupportedAuthenticator(@CheckForNull BitbucketAuthenticator
147148
return authenticator == null
148149
|| authenticator instanceof BitbucketAccessTokenAuthenticator
149150
|| authenticator instanceof BitbucketOAuthAuthenticator
151+
|| authenticator instanceof BitbucketUserAPITokenAuthenticator // API access token
150152
|| authenticator instanceof BitbucketUsernamePasswordAuthenticator; // app password
151153
}
152154

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/*
2+
* The MIT License
3+
*
4+
* Copyright (c) 2025, Falco Nikolas
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
25+
26+
package com.cloudbees.jenkins.plugins.bitbucket.impl.credentials;
27+
28+
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketAuthenticator;
29+
import com.cloudbees.plugins.credentials.CredentialsScope;
30+
import com.cloudbees.plugins.credentials.common.StandardUsernameCredentials;
31+
import com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials;
32+
import com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl;
33+
import hudson.model.Descriptor.FormException;
34+
import hudson.util.Secret;
35+
import java.nio.charset.StandardCharsets;
36+
import org.apache.hc.client5.http.utils.Base64;
37+
import org.apache.hc.core5.http.HttpHeaders;
38+
import org.apache.hc.core5.http.HttpRequest;
39+
40+
/**
41+
* Authenticator that uses a username and password (probably the default)
42+
*/
43+
public class BitbucketUserAPITokenAuthenticator implements BitbucketAuthenticator {
44+
45+
private final String encodedAuth;
46+
private final String credentialsId;
47+
private final Secret password;
48+
49+
/**
50+
* Constructor.
51+
* @param credentials the username/password that will be used
52+
*/
53+
public BitbucketUserAPITokenAuthenticator(StandardUsernamePasswordCredentials credentials) {
54+
credentialsId = credentials.getId();
55+
password = credentials.getPassword();
56+
String auth = credentials.getUsername() + ":" + Secret.toString(password);
57+
encodedAuth = Base64.encodeBase64String(auth.getBytes(StandardCharsets.ISO_8859_1));
58+
}
59+
60+
@Override
61+
public void configureRequest(HttpRequest request) {
62+
final String authHeader = "Basic " + encodedAuth;
63+
request.setHeader(HttpHeaders.AUTHORIZATION, authHeader);
64+
}
65+
66+
@Override
67+
public StandardUsernameCredentials getCredentialsForSCM() {
68+
try {
69+
return new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, getId(), "User API token for " + getId(), "x-bitbucket-api-token-auth", Secret.toString(password));
70+
} catch (FormException e) {
71+
throw new RuntimeException(e);
72+
}
73+
}
74+
75+
@Override
76+
public String getId() {
77+
return credentialsId;
78+
}
79+
80+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/*
2+
* The MIT License
3+
*
4+
* Copyright (c) 2025, Falco Nikolas
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
25+
package com.cloudbees.jenkins.plugins.bitbucket.impl.credentials;
26+
27+
import com.cloudbees.plugins.credentials.CredentialsMatcher;
28+
import com.cloudbees.plugins.credentials.CredentialsMatchers;
29+
import com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials;
30+
import edu.umd.cs.findbugs.annotations.NonNull;
31+
import hudson.Extension;
32+
import jenkins.authentication.tokens.api.AuthenticationTokenSource;
33+
34+
/**
35+
* Source for username/password authenticators.
36+
*/
37+
@Extension
38+
public class BitbucketUserAPITokenAuthenticatorSource
39+
extends AuthenticationTokenSource<BitbucketUserAPITokenAuthenticator, StandardUsernamePasswordCredentials> {
40+
41+
/**
42+
* Constructor.
43+
*/
44+
public BitbucketUserAPITokenAuthenticatorSource() {
45+
super(BitbucketUserAPITokenAuthenticator.class, StandardUsernamePasswordCredentials.class);
46+
}
47+
48+
/**
49+
* Converts username/password credentials to an authenticator.
50+
*
51+
* @param credentials the username/password combo
52+
* @return an authenticator that will use them.
53+
*/
54+
@NonNull
55+
@Override
56+
public BitbucketUserAPITokenAuthenticator convert(@NonNull StandardUsernamePasswordCredentials credentials) {
57+
return new BitbucketUserAPITokenAuthenticator(credentials);
58+
}
59+
60+
/**
61+
* {@inheritDoc}
62+
*/
63+
@Override
64+
public CredentialsMatcher matcher() {
65+
return CredentialsMatchers.allOf(super.matcher(), new BitbucketUserAPITokenCredentialMatcher());
66+
}
67+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*
2+
* The MIT License
3+
*
4+
* Copyright (c) 2025, Falco Nikolas
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
package com.cloudbees.jenkins.plugins.bitbucket.impl.credentials;
25+
26+
import com.cloudbees.plugins.credentials.Credentials;
27+
import com.cloudbees.plugins.credentials.CredentialsMatcher;
28+
import com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials;
29+
import hudson.util.Secret;
30+
31+
// Although the CredentialsMatcher documentation says that the best practice
32+
// is to implement CredentialsMatcher.CQL too, this class does not implement
33+
// CredentialsMatcher.CQL, for the following reasons:
34+
//
35+
// * CQL supports neither method calls like StringUtils.isNotBlank(username)
36+
// nor any regular-expression matching that could be used instead.
37+
// * There don't seem to be any public credential-provider plugins that
38+
// would benefit from CQL.
39+
public class BitbucketUserAPITokenCredentialMatcher implements CredentialsMatcher {
40+
private static final long serialVersionUID = -9196480589659636909L;
41+
42+
private static final int API_ACCESS_TOKEN_LENGTH = 192;
43+
44+
/**
45+
* {@inheritDoc}
46+
*/
47+
@Override
48+
public boolean matches(Credentials item) {
49+
if (!(item instanceof StandardUsernamePasswordCredentials)) { // safety check
50+
return false;
51+
}
52+
53+
StandardUsernamePasswordCredentials credential = ((StandardUsernamePasswordCredentials) item);
54+
String username = credential.getUsername();
55+
String password = Secret.toString(credential.getPassword());
56+
57+
boolean isEMail = username.contains(".") && username.contains("@");
58+
boolean validSecretLength = password.length() == API_ACCESS_TOKEN_LENGTH;
59+
60+
return isEMail && validSecretLength;
61+
}
62+
}

src/main/java/com/cloudbees/jenkins/plugins/bitbucket/impl/util/BitbucketCredentialsUtils.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import com.cloudbees.jenkins.plugins.bitbucket.api.endpoint.BitbucketEndpointProvider;
2828
import com.cloudbees.jenkins.plugins.bitbucket.endpoints.BitbucketEndpointConfiguration;
2929
import com.cloudbees.jenkins.plugins.bitbucket.impl.credentials.BitbucketOAuthAuthenticatorSource;
30+
import com.cloudbees.jenkins.plugins.bitbucket.impl.credentials.BitbucketUserAPITokenAuthenticatorSource;
3031
import com.cloudbees.jenkins.plugins.bitbucket.impl.credentials.BitbucketUsernamePasswordAuthenticatorSource;
3132
import com.cloudbees.plugins.credentials.Credentials;
3233
import com.cloudbees.plugins.credentials.CredentialsMatcher;
@@ -229,7 +230,8 @@ private static <T> CredentialsMatcher matcher(AuthenticationTokenContext<T> cont
229230
if (source.fits(context)) {
230231
CredentialsMatcher matcher = source.matcher();
231232
if (source instanceof BitbucketUsernamePasswordAuthenticatorSource
232-
|| source instanceof BitbucketOAuthAuthenticatorSource) {
233+
|| source instanceof BitbucketOAuthAuthenticatorSource
234+
|| source instanceof BitbucketUserAPITokenAuthenticatorSource) {
233235
matcher = new TimeBoxedCredentialsMatcher(matcher);
234236
}
235237
matchers.add(matcher);

src/test/java/com/cloudbees/jenkins/plugins/bitbucket/BitbucketGitSCMBuilderTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
package com.cloudbees.jenkins.plugins.bitbucket;
2525

2626
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketHref;
27+
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketMockApiFactory;
2728
import com.cloudbees.jenkins.plugins.bitbucket.api.PullRequestBranchType;
2829
import com.cloudbees.jenkins.plugins.bitbucket.client.branch.BitbucketCloudAuthor;
2930
import com.cloudbees.jenkins.plugins.bitbucket.client.branch.BitbucketCloudCommit;

src/test/java/com/cloudbees/jenkins/plugins/bitbucket/BitbucketGitSCMRevisionTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
*/
2424
package com.cloudbees.jenkins.plugins.bitbucket;
2525

26+
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketMockApiFactory;
2627
import com.cloudbees.jenkins.plugins.bitbucket.impl.endpoint.BitbucketCloudEndpoint;
28+
import com.cloudbees.jenkins.plugins.bitbucket.test.util.BitbucketClientMockUtils;
2729
import com.cloudbees.jenkins.plugins.bitbucket.trait.BranchDiscoveryTrait;
2830
import com.cloudbees.jenkins.plugins.bitbucket.trait.ForkPullRequestDiscoveryTrait;
2931
import com.cloudbees.jenkins.plugins.bitbucket.trait.ForkPullRequestDiscoveryTrait.TrustTeamForks;

src/test/java/com/cloudbees/jenkins/plugins/bitbucket/BitbucketSCMSourceBuildTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketApi;
2727
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketHref;
28+
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketMockApiFactory;
2829
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRepository;
2930
import com.cloudbees.jenkins.plugins.bitbucket.impl.extension.BitbucketEnvVarExtension;
3031
import com.cloudbees.jenkins.plugins.bitbucket.impl.extension.GitClientAuthenticatorExtension;

src/test/java/com/cloudbees/jenkins/plugins/bitbucket/BitbucketSCMSourceRetrieveTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketApi;
2727
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketBranch;
2828
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketCommit;
29+
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketMockApiFactory;
2930
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketPullRequest;
3031
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketPullRequestDestination;
3132
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketPullRequestEvent;
@@ -38,6 +39,7 @@
3839
import com.cloudbees.jenkins.plugins.bitbucket.impl.endpoint.BitbucketCloudEndpoint;
3940
import com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient;
4041
import com.cloudbees.jenkins.plugins.bitbucket.server.client.branch.BitbucketServerBranch;
42+
import com.cloudbees.jenkins.plugins.bitbucket.test.util.BitbucketClientMockUtils;
4143
import com.cloudbees.jenkins.plugins.bitbucket.trait.ForkPullRequestDiscoveryTrait;
4244
import com.cloudbees.jenkins.plugins.bitbucket.trait.ForkPullRequestDiscoveryTrait.TrustEveryone;
4345
import edu.umd.cs.findbugs.annotations.NonNull;

src/test/java/com/cloudbees/jenkins/plugins/bitbucket/BitbucketSCMSourceTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
package com.cloudbees.jenkins.plugins.bitbucket;
2525

2626
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketApi;
27+
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketMockApiFactory;
2728
import com.cloudbees.jenkins.plugins.bitbucket.api.endpoint.BitbucketEndpoint;
2829
import com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketIntegrationClientFactory;
2930
import com.cloudbees.jenkins.plugins.bitbucket.client.pullrequest.BitbucketCloudPullRequestCommit;

src/test/java/com/cloudbees/jenkins/plugins/bitbucket/BranchScanningIntegrationTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@
2323
*/
2424
package com.cloudbees.jenkins.plugins.bitbucket;
2525

26+
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketMockApiFactory;
2627
import com.cloudbees.jenkins.plugins.bitbucket.endpoints.BitbucketEndpointConfiguration;
2728
import com.cloudbees.jenkins.plugins.bitbucket.impl.endpoint.BitbucketServerEndpoint;
2829
import com.cloudbees.jenkins.plugins.bitbucket.impl.util.BitbucketCredentialsUtils;
30+
import com.cloudbees.jenkins.plugins.bitbucket.test.util.BitbucketClientMockUtils;
2931
import com.cloudbees.jenkins.plugins.bitbucket.trait.BranchDiscoveryTrait;
3032
import com.cloudbees.jenkins.plugins.bitbucket.trait.ForkPullRequestDiscoveryTrait;
3133
import com.cloudbees.jenkins.plugins.bitbucket.trait.OriginPullRequestDiscoveryTrait;

src/test/java/com/cloudbees/jenkins/plugins/bitbucket/BranchScanningTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@
2424
package com.cloudbees.jenkins.plugins.bitbucket;
2525

2626
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketHref;
27+
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketMockApiFactory;
2728
import com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient;
2829
import com.cloudbees.jenkins.plugins.bitbucket.impl.endpoint.BitbucketCloudEndpoint;
30+
import com.cloudbees.jenkins.plugins.bitbucket.test.util.BitbucketClientMockUtils;
2931
import com.cloudbees.jenkins.plugins.bitbucket.trait.BranchDiscoveryTrait;
3032
import com.cloudbees.jenkins.plugins.bitbucket.trait.ForkPullRequestDiscoveryTrait;
3133
import com.cloudbees.jenkins.plugins.bitbucket.trait.OriginPullRequestDiscoveryTrait;

src/test/java/com/cloudbees/jenkins/plugins/bitbucket/SCMNavigatorTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
*/
2424
package com.cloudbees.jenkins.plugins.bitbucket;
2525

26+
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketMockApiFactory;
27+
import com.cloudbees.jenkins.plugins.bitbucket.test.util.BitbucketClientMockUtils;
2628
import edu.umd.cs.findbugs.annotations.NonNull;
2729
import hudson.model.TaskListener;
2830
import java.io.IOException;

src/test/java/com/cloudbees/jenkins/plugins/bitbucket/SCMTraitCommitTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@
2525

2626
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketBranch;
2727
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketCommit;
28+
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketMockApiFactory;
2829
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketPullRequest;
2930
import com.cloudbees.jenkins.plugins.bitbucket.impl.endpoint.BitbucketCloudEndpoint;
31+
import com.cloudbees.jenkins.plugins.bitbucket.test.util.BitbucketClientMockUtils;
3032
import com.cloudbees.jenkins.plugins.bitbucket.trait.BranchDiscoveryTrait;
3133
import com.cloudbees.jenkins.plugins.bitbucket.trait.ForkPullRequestDiscoveryTrait;
3234
import com.cloudbees.jenkins.plugins.bitbucket.trait.OriginPullRequestDiscoveryTrait;

src/test/java/com/cloudbees/jenkins/plugins/bitbucket/WebhooksAutoregisterTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
package com.cloudbees.jenkins.plugins.bitbucket;
2525

2626
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketApi;
27+
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketMockApiFactory;
2728
import com.cloudbees.jenkins.plugins.bitbucket.endpoints.BitbucketEndpointConfiguration;
2829
import com.cloudbees.jenkins.plugins.bitbucket.hooks.WebhookAutoRegisterListener;
2930
import com.cloudbees.jenkins.plugins.bitbucket.impl.endpoint.BitbucketCloudEndpoint;

0 commit comments

Comments
 (0)