use of org.eclipse.che.api.factory.server.bitbucket.server.BitbucketServerApiClient in project che-server by eclipse-che.
the class BitbucketServerApiClientProviderTest method shouldNormalizeURLsBeforeCreateBitbucketServerApi.
@Test
public void shouldNormalizeURLsBeforeCreateBitbucketServerApi() {
// 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);
// internal representation always w/out slashes
assertTrue(actual.isConnected("https://bitbucket.server.com"));
}
use of org.eclipse.che.api.factory.server.bitbucket.server.BitbucketServerApiClient in project che-server by eclipse-che.
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()));
}
use of org.eclipse.che.api.factory.server.bitbucket.server.BitbucketServerApiClient in project devspaces-images by redhat-developer.
the class BitbucketServerApiClientProviderTest method shouldNormalizeURLsBeforeCreateBitbucketServerApi.
@Test
public void shouldNormalizeURLsBeforeCreateBitbucketServerApi() {
// 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);
// internal representation always w/out slashes
assertTrue(actual.isConnected("https://bitbucket.server.com"));
}
use of org.eclipse.che.api.factory.server.bitbucket.server.BitbucketServerApiClient in project che-server by eclipse-che.
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()));
}
use of org.eclipse.che.api.factory.server.bitbucket.server.BitbucketServerApiClient in project che-server by eclipse-che.
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()));
}
Aggregations