Package com.openshift.internal.client.httpclient

Examples of com.openshift.internal.client.httpclient.HttpClientException


  @Test(expected = InvalidCredentialsOpenShiftException.class)
  public void shouldThrowIfInvalidCredentials() throws Exception {
    // dont test on dev server
    OpenShiftTestConfiguration configuration = new OpenShiftTestConfiguration();
    if (configuration.isDevelopmentServer()) {
      throw new InvalidCredentialsOpenShiftException(null, new HttpClientException(""), null);
    }

    new TestConnectionBuilder()
      .credentials(configuration.getClientId(), "bogus-password").create().getUser()
  }
View Full Code Here


  @Test
  public void shouldReportServerInTimeoutExceptionMessage() throws FileNotFoundException, OpenShiftException, IOException {
    try {
      // pre-conditions
      mockDirector.mockGetAPI(
          new HttpClientException(new ConnectException("java.net.ConnectException: Connection timed out")));
      // operation
      new TestConnectionBuilder().defaultCredentials().create(clientMock);
      // verification
      fail("exception expected");
    } catch (OpenShiftEndpointException e) {
View Full Code Here

  @Test
  public void shouldHaveMessageIfErrors() throws Exception {
    try {
      // pre-conditions
      mockDirector
          .mockPostAny(new HttpClientException(Samples.POST_FOOBAR_DOMAINS_KO_INUSE.getContentAsString()));
      // operation
      service.request(new TestLink("0 require parameter", "/broker/rest/domains", HttpMethod.POST),
          IHttpClient.NO_TIMEOUT, Collections.<Parameter> emptyList(), Collections.<Parameter> emptyList());
      // verifications
      fail("OpenShiftEndPointException expected, did not occurr");
View Full Code Here

  @Test
  public void shouldReportPlatformUrlInException() throws Exception {
    try {
      // pre-conditions
      mockDirector
          .mockPostAny(new HttpClientException(Samples.POST_FOOBAR_DOMAINS_KO_INUSE.getContentAsString()));
      // operation
      service.request(new TestLink("0 require parameter", "/broker/rest/domains", HttpMethod.POST),
          IHttpClient.NO_TIMEOUT, Collections.<Parameter> emptyList(), Collections.<Parameter> emptyList());
      // verifications
      fail("OpenShiftEndPointException expected, did not occurr");
View Full Code Here

TOP

Related Classes of com.openshift.internal.client.httpclient.HttpClientException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.