use of org.jboss.tools.openshift.core.LazyCredentialsPrompter in project jbosstools-openshift by jbosstools.
the class ConnectionFactory method create.
@Override
public Connection create(String url) {
if (StringUtils.isEmpty(url)) {
return null;
}
try {
LazySSLCertificateCallback sslCertCallback = new LazySSLCertificateCallback();
IClient client = new ClientBuilder(url).sslCertificateCallback(sslCertCallback).withMaxRequests(ConnectionProperties.MAX_REQUESTS).withMaxRequestsPerHost(ConnectionProperties.MAX_REQUESTS).build();
return new Connection(client, new LazyCredentialsPrompter());
} catch (OpenShiftException e) {
OpenShiftCoreActivator.pluginLog().logInfo(NLS.bind("Could not create OpenShift connection: Malformed url {0}", url), e);
return null;
}
}
use of org.jboss.tools.openshift.core.LazyCredentialsPrompter in project jbosstools-openshift by jbosstools.
the class LazyCredentialsPrompterTest method setup.
@Before
public void setup() throws MalformedURLException {
when(client.getBaseURL()).thenReturn(new URL("https://localhost:8443"));
this.lazyPrompter = spy(new LazyCredentialsPrompter());
this.connection = new Connection(client.getBaseURL().toString(), lazyPrompter, null);
when(permissiveExtensionPrompter.promptAndAuthenticate(connection, null)).thenReturn(true);
when(denyingExtensionPrompter.promptAndAuthenticate(connection, null)).thenReturn(true);
}
Aggregations