Search in sources :

Example 1 with NoopOAuthAuthenticator

use of org.eclipse.che.security.oauth1.NoopOAuthAuthenticator in project che-server by eclipse-che.

the class HttpBitbucketServerApiClientTest method shouldThrowScmCommunicationExceptionInNoOauthAuthenticator.

@Test(expectedExceptions = ScmCommunicationException.class, expectedExceptionsMessageRegExp = "The fallback noop authenticator cannot be used for authentication. Make sure OAuth is properly configured.")
public void shouldThrowScmCommunicationExceptionInNoOauthAuthenticator() throws ScmCommunicationException, ScmUnauthorizedException, ScmItemNotFoundException {
    HttpBitbucketServerApiClient localServer = new HttpBitbucketServerApiClient(wireMockServer.url("/"), new NoopOAuthAuthenticator());
    // when
    localServer.getPersonalAccessToken("ksmster", 5L);
}
Also used : NoopOAuthAuthenticator(org.eclipse.che.security.oauth1.NoopOAuthAuthenticator) HttpBitbucketServerApiClient(org.eclipse.che.api.factory.server.bitbucket.server.HttpBitbucketServerApiClient) Test(org.testng.annotations.Test)

Example 2 with NoopOAuthAuthenticator

use of org.eclipse.che.security.oauth1.NoopOAuthAuthenticator in project devspaces-images by redhat-developer.

the class HttpBitbucketServerApiClientTest method shouldThrowScmCommunicationExceptionInNoOauthAuthenticator.

@Test(expectedExceptions = ScmCommunicationException.class, expectedExceptionsMessageRegExp = "The fallback noop authenticator cannot be used for authentication. Make sure OAuth is properly configured.")
public void shouldThrowScmCommunicationExceptionInNoOauthAuthenticator() throws ScmCommunicationException, ScmUnauthorizedException, ScmItemNotFoundException {
    HttpBitbucketServerApiClient localServer = new HttpBitbucketServerApiClient(wireMockServer.url("/"), new NoopOAuthAuthenticator());
    // when
    localServer.getPersonalAccessToken("ksmster", 5L);
}
Also used : NoopOAuthAuthenticator(org.eclipse.che.security.oauth1.NoopOAuthAuthenticator) HttpBitbucketServerApiClient(org.eclipse.che.api.factory.server.bitbucket.server.HttpBitbucketServerApiClient) Test(org.testng.annotations.Test)

Aggregations

HttpBitbucketServerApiClient (org.eclipse.che.api.factory.server.bitbucket.server.HttpBitbucketServerApiClient)2 NoopOAuthAuthenticator (org.eclipse.che.security.oauth1.NoopOAuthAuthenticator)2 Test (org.testng.annotations.Test)2