Search in sources :

Example 6 with BitbucketServerApiClient

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

the class BitbucketServerApiClientProviderTest method shouldBeAbleToCreateBitbucketServerApi.

@Test
public void shouldBeAbleToCreateBitbucketServerApi() {
    // given
    BitbucketServerApiProvider bitbucketServerApiProvider = new BitbucketServerApiProvider("https://bitbucket.server.com, https://bitbucket2.server.com", "https://bitbucket.server.com", ImmutableSet.of(oAuthAuthenticator));
    // when
    BitbucketServerApiClient actual = bitbucketServerApiProvider.get();
    // then
    assertNotNull(actual);
    assertTrue(HttpBitbucketServerApiClient.class.isAssignableFrom(actual.getClass()));
}
Also used : NoopBitbucketServerApiClient(org.eclipse.che.api.factory.server.bitbucket.server.NoopBitbucketServerApiClient) BitbucketServerApiClient(org.eclipse.che.api.factory.server.bitbucket.server.BitbucketServerApiClient) HttpBitbucketServerApiClient(org.eclipse.che.api.factory.server.bitbucket.server.HttpBitbucketServerApiClient) HttpBitbucketServerApiClient(org.eclipse.che.api.factory.server.bitbucket.server.HttpBitbucketServerApiClient) Test(org.testng.annotations.Test)

Example 7 with BitbucketServerApiClient

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

the class BitbucketServerApiClientProviderTest method shouldProvideHttpAuthenticatorIfOauthConfigurationIsNotSet.

@Test(dataProvider = "httpOnlyConfig")
public void shouldProvideHttpAuthenticatorIfOauthConfigurationIsNotSet(@Nullable String bitbucketEndpoints, @Nullable String bitbucketOauth1Endpoint, Set<OAuthAuthenticator> authenticators) throws IOException {
    // given
    BitbucketServerApiProvider bitbucketServerApiProvider = new BitbucketServerApiProvider(bitbucketEndpoints, bitbucketOauth1Endpoint, authenticators);
    // when
    BitbucketServerApiClient actual = bitbucketServerApiProvider.get();
    // then
    assertNotNull(actual);
    assertTrue(HttpBitbucketServerApiClient.class.isAssignableFrom(actual.getClass()));
}
Also used : NoopBitbucketServerApiClient(org.eclipse.che.api.factory.server.bitbucket.server.NoopBitbucketServerApiClient) BitbucketServerApiClient(org.eclipse.che.api.factory.server.bitbucket.server.BitbucketServerApiClient) HttpBitbucketServerApiClient(org.eclipse.che.api.factory.server.bitbucket.server.HttpBitbucketServerApiClient) HttpBitbucketServerApiClient(org.eclipse.che.api.factory.server.bitbucket.server.HttpBitbucketServerApiClient) Test(org.testng.annotations.Test)

Example 8 with BitbucketServerApiClient

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

the class BitbucketServerApiClientProviderTest method shouldProvideNoopOAuthAuthenticatorIfSomeConfigurationIsNotSet.

@Test(dataProvider = "noopConfig")
public void shouldProvideNoopOAuthAuthenticatorIfSomeConfigurationIsNotSet(@Nullable String bitbucketEndpoints, @Nullable String bitbucketOauth1Endpoint, Set<OAuthAuthenticator> authenticators) throws IOException {
    // given
    BitbucketServerApiProvider bitbucketServerApiProvider = new BitbucketServerApiProvider(bitbucketEndpoints, bitbucketOauth1Endpoint, authenticators);
    // when
    BitbucketServerApiClient actual = bitbucketServerApiProvider.get();
    // then
    assertNotNull(actual);
    assertTrue(NoopBitbucketServerApiClient.class.isAssignableFrom(actual.getClass()));
}
Also used : NoopBitbucketServerApiClient(org.eclipse.che.api.factory.server.bitbucket.server.NoopBitbucketServerApiClient) BitbucketServerApiClient(org.eclipse.che.api.factory.server.bitbucket.server.BitbucketServerApiClient) HttpBitbucketServerApiClient(org.eclipse.che.api.factory.server.bitbucket.server.HttpBitbucketServerApiClient) NoopBitbucketServerApiClient(org.eclipse.che.api.factory.server.bitbucket.server.NoopBitbucketServerApiClient) Test(org.testng.annotations.Test)

Aggregations

BitbucketServerApiClient (org.eclipse.che.api.factory.server.bitbucket.server.BitbucketServerApiClient)8 HttpBitbucketServerApiClient (org.eclipse.che.api.factory.server.bitbucket.server.HttpBitbucketServerApiClient)8 NoopBitbucketServerApiClient (org.eclipse.che.api.factory.server.bitbucket.server.NoopBitbucketServerApiClient)8 Test (org.testng.annotations.Test)8