Search in sources :

Example 1 with Slf4jNotifier

use of com.github.tomakehurst.wiremock.common.Slf4jNotifier in project che-server by eclipse-che.

the class HttpBitbucketServerApiClientTest method start.

@BeforeMethod
void start() {
    wireMockServer = new WireMockServer(wireMockConfig().notifier(new Slf4jNotifier(false)).dynamicPort());
    wireMockServer.start();
    WireMock.configureFor("localhost", wireMockServer.port());
    wireMock = new WireMock("localhost", wireMockServer.port());
    bitbucketServer = new HttpBitbucketServerApiClient(wireMockServer.url("/"), new BitbucketServerOAuthAuthenticator("", "", "", "") {

        @Override
        public String computeAuthorizationHeader(String userId, String requestMethod, String requestUrl) throws OAuthAuthenticationException {
            return AUTHORIZATION_TOKEN;
        }
    });
}
Also used : BitbucketServerOAuthAuthenticator(org.eclipse.che.security.oauth1.BitbucketServerOAuthAuthenticator) HttpBitbucketServerApiClient(org.eclipse.che.api.factory.server.bitbucket.server.HttpBitbucketServerApiClient) WireMockServer(com.github.tomakehurst.wiremock.WireMockServer) Slf4jNotifier(com.github.tomakehurst.wiremock.common.Slf4jNotifier) WireMock(com.github.tomakehurst.wiremock.client.WireMock) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 2 with Slf4jNotifier

use of com.github.tomakehurst.wiremock.common.Slf4jNotifier in project che-server by eclipse-che.

the class GithubPersonalAccessTokenFetcherTest method start.

@BeforeMethod
void start() {
    wireMockServer = new WireMockServer(wireMockConfig().notifier(new Slf4jNotifier(false)).port(httpPort));
    wireMockServer.start();
    WireMock.configureFor("localhost", httpPort);
    wireMock = new WireMock("localhost", httpPort);
    githubPATFetcher = new GithubPersonalAccessTokenFetcher("http://che.api", oAuthAPI, new GithubApiClient(wireMockServer.url("/")));
}
Also used : WireMockServer(com.github.tomakehurst.wiremock.WireMockServer) Slf4jNotifier(com.github.tomakehurst.wiremock.common.Slf4jNotifier) WireMock(com.github.tomakehurst.wiremock.client.WireMock) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 3 with Slf4jNotifier

use of com.github.tomakehurst.wiremock.common.Slf4jNotifier in project che-server by eclipse-che.

the class GitlabOAuthTokenFetcherTest method start.

@BeforeMethod
void start() {
    wireMockServer = new WireMockServer(wireMockConfig().notifier(new Slf4jNotifier(false)).dynamicPort());
    wireMockServer.start();
    WireMock.configureFor("localhost", wireMockServer.port());
    wireMock = new WireMock("localhost", wireMockServer.port());
    oAuthTokenFetcher = new GitlabOAuthTokenFetcher(wireMockServer.url("/"), wireMockServer.url("/"), "http://che.api", oAuthAPI);
}
Also used : WireMockServer(com.github.tomakehurst.wiremock.WireMockServer) Slf4jNotifier(com.github.tomakehurst.wiremock.common.Slf4jNotifier) WireMock(com.github.tomakehurst.wiremock.client.WireMock) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 4 with Slf4jNotifier

use of com.github.tomakehurst.wiremock.common.Slf4jNotifier in project che-server by eclipse-che.

the class GitlabApiClientTest method start.

@BeforeMethod
void start() {
    wireMockServer = new WireMockServer(wireMockConfig().notifier(new Slf4jNotifier(false)).dynamicPort());
    wireMockServer.start();
    WireMock.configureFor("localhost", wireMockServer.port());
    wireMock = new WireMock("localhost", wireMockServer.port());
    client = new GitlabApiClient(wireMockServer.url("/"));
}
Also used : WireMockServer(com.github.tomakehurst.wiremock.WireMockServer) Slf4jNotifier(com.github.tomakehurst.wiremock.common.Slf4jNotifier) WireMock(com.github.tomakehurst.wiremock.client.WireMock) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 5 with Slf4jNotifier

use of com.github.tomakehurst.wiremock.common.Slf4jNotifier in project devspaces-images by redhat-developer.

the class HttpBitbucketServerApiClientTest method start.

@BeforeMethod
void start() {
    wireMockServer = new WireMockServer(wireMockConfig().notifier(new Slf4jNotifier(false)).dynamicPort());
    wireMockServer.start();
    WireMock.configureFor("localhost", wireMockServer.port());
    wireMock = new WireMock("localhost", wireMockServer.port());
    bitbucketServer = new HttpBitbucketServerApiClient(wireMockServer.url("/"), new BitbucketServerOAuthAuthenticator("", "", "", "") {

        @Override
        public String computeAuthorizationHeader(String userId, String requestMethod, String requestUrl) throws OAuthAuthenticationException {
            return AUTHORIZATION_TOKEN;
        }
    });
}
Also used : BitbucketServerOAuthAuthenticator(org.eclipse.che.security.oauth1.BitbucketServerOAuthAuthenticator) HttpBitbucketServerApiClient(org.eclipse.che.api.factory.server.bitbucket.server.HttpBitbucketServerApiClient) WireMockServer(com.github.tomakehurst.wiremock.WireMockServer) Slf4jNotifier(com.github.tomakehurst.wiremock.common.Slf4jNotifier) WireMock(com.github.tomakehurst.wiremock.client.WireMock) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

Slf4jNotifier (com.github.tomakehurst.wiremock.common.Slf4jNotifier)17 WireMockServer (com.github.tomakehurst.wiremock.WireMockServer)15 WireMock (com.github.tomakehurst.wiremock.client.WireMock)10 BeforeMethod (org.testng.annotations.BeforeMethod)10 PostConstruct (javax.annotation.PostConstruct)2 HttpBitbucketServerApiClient (org.eclipse.che.api.factory.server.bitbucket.server.HttpBitbucketServerApiClient)2 BitbucketServerOAuthAuthenticator (org.eclipse.che.security.oauth1.BitbucketServerOAuthAuthenticator)2 Options (com.github.tomakehurst.wiremock.core.Options)1 WireMockApp (com.github.tomakehurst.wiremock.core.WireMockApp)1 WireMockConfiguration (com.github.tomakehurst.wiremock.core.WireMockConfiguration)1 ResponseTemplateTransformer (com.github.tomakehurst.wiremock.extension.responsetemplating.ResponseTemplateTransformer)1 AdminRequestHandler (com.github.tomakehurst.wiremock.http.AdminRequestHandler)1 StubRequestHandler (com.github.tomakehurst.wiremock.http.StubRequestHandler)1 ThreadPoolFactory (com.github.tomakehurst.wiremock.http.ThreadPoolFactory)1 QueuedDaemonThreadPool (fr.insee.sugoi.app.service.utils.QueuedDaemonThreadPool)1 PostConstruct (jakarta.annotation.PostConstruct)1 ServletContext (javax.servlet.ServletContext)1 BeforeClass (org.junit.BeforeClass)1 ThreadPool (wiremock.org.eclipse.jetty.util.thread.ThreadPool)1