Search in sources :

Example 11 with IClient

use of com.openshift.restclient.IClient in project jbosstools-openshift by jbosstools.

the class ConnectionTestUtils method createClient.

public static IClient createClient(String username, String token, String host) throws MalformedURLException {
    IClient client = mock(IClient.class);
    when(client.getBaseURL()).thenReturn(new URL(host));
    doReturn(mockAuthorizationContext(username, token, true)).when(client).getAuthorizationContext();
    return client;
}
Also used : IClient(com.openshift.restclient.IClient) URL(java.net.URL)

Example 12 with IClient

use of com.openshift.restclient.IClient in project wildfly-swarm by wildfly-swarm.

the class ServiceWatcher method startWatcher.

private void startWatcher() {
    IClient client = clientInjector.getValue();
    listenerState.set(ListenerState.STARTING);
    openShiftWatcher = client.watch(namespaceInjector.getValue(), this, ResourceKind.SERVICE);
}
Also used : IClient(com.openshift.restclient.IClient)

Aggregations

IClient (com.openshift.restclient.IClient)12 OpenShiftException (com.openshift.restclient.OpenShiftException)4 ClientBuilder (com.openshift.restclient.ClientBuilder)3 IResource (com.openshift.restclient.model.IResource)3 IConnection (org.jboss.tools.openshift.common.core.connection.IConnection)3 LazySSLCertificateCallback (org.jboss.tools.openshift.core.LazySSLCertificateCallback)3 Connection (org.jboss.tools.openshift.core.connection.Connection)3 ISSLCertificateCallback (com.openshift.restclient.ISSLCertificateCallback)2 IOException (java.io.IOException)2 TimeoutException (java.util.concurrent.TimeoutException)2 CoreException (org.eclipse.core.runtime.CoreException)2 CommandTimeoutException (org.jboss.tools.openshift.cdk.server.core.internal.adapter.controllers.CommandTimeoutException)2 RequiredBasicConnection (org.jboss.tools.openshift.reddeer.requirement.OpenShiftConnectionRequirement.RequiredBasicConnection)2 Test (org.junit.Test)2 Matchers.anyString (org.mockito.Matchers.anyString)2 IAuthorizationContext (com.openshift.restclient.authorization.IAuthorizationContext)1 CapabilityVisitor (com.openshift.restclient.capability.CapabilityVisitor)1 IClientCapability (com.openshift.restclient.capability.resources.IClientCapability)1 URL (java.net.URL)1 HashMap (java.util.HashMap)1