Search in sources :

Example 6 with BitbucketUser

use of org.eclipse.che.api.factory.server.bitbucket.server.BitbucketUser in project devspaces-images by redhat-developer.

the class HttpBitbucketServerApiClientTest method testGetUser.

@Test
public void testGetUser() throws ScmItemNotFoundException, ScmUnauthorizedException, ScmCommunicationException {
    stubFor(get(urlEqualTo("/rest/api/1.0/users/ksmster")).withHeader(HttpHeaders.AUTHORIZATION, equalTo(AUTHORIZATION_TOKEN)).willReturn(aResponse().withHeader("Content-Type", "application/json; charset=utf-8").withBodyFile("bitbucket/rest/api/1.0/users/ksmster/response.json")));
    BitbucketUser user = bitbucketServer.getUser("ksmster");
    assertNotNull(user);
}
Also used : BitbucketUser(org.eclipse.che.api.factory.server.bitbucket.server.BitbucketUser) Test(org.testng.annotations.Test)

Aggregations

BitbucketUser (org.eclipse.che.api.factory.server.bitbucket.server.BitbucketUser)6 URL (java.net.URL)4 BitbucketPersonalAccessToken (org.eclipse.che.api.factory.server.bitbucket.server.BitbucketPersonalAccessToken)4 EnvironmentContext (org.eclipse.che.commons.env.EnvironmentContext)4 ImmutableSet (com.google.common.collect.ImmutableSet)2 String.format (java.lang.String.format)2 String.valueOf (java.lang.String.valueOf)2 List (java.util.List)2 Optional (java.util.Optional)2 Set (java.util.Set)2 Collectors (java.util.stream.Collectors)2 Inject (javax.inject.Inject)2 Named (javax.inject.Named)2 BitbucketServerApiClient (org.eclipse.che.api.factory.server.bitbucket.server.BitbucketServerApiClient)2 PersonalAccessToken (org.eclipse.che.api.factory.server.scm.PersonalAccessToken)2 PersonalAccessTokenFetcher (org.eclipse.che.api.factory.server.scm.PersonalAccessTokenFetcher)2 ScmBadRequestException (org.eclipse.che.api.factory.server.scm.exception.ScmBadRequestException)2 ScmCommunicationException (org.eclipse.che.api.factory.server.scm.exception.ScmCommunicationException)2 ScmItemNotFoundException (org.eclipse.che.api.factory.server.scm.exception.ScmItemNotFoundException)2 ScmUnauthorizedException (org.eclipse.che.api.factory.server.scm.exception.ScmUnauthorizedException)2