Examples of RequestError


Examples of com.eclipsesource.jaxrs.consumer.internal.RequestError

    new RequestException( null );
  }
 
  @Test
  public void testHasStatus() {
    RequestError error = mock( RequestError.class );
    when( error.getStatus() ).thenReturn( 233 );
    RequestException exception = new RequestException( error );
   
    int status = exception.getStatus();
   
    assertEquals( 233, status );
View Full Code Here

Examples of com.eclipsesource.jaxrs.consumer.internal.RequestError

    assertEquals( 233, status );
  }
 
  @Test
  public void testHasMessage() {
    RequestError error = mock( RequestError.class );
    when( error.getMessage() ).thenReturn( "foo" );
    RequestException exception = new RequestException( error );
   
    String message = exception.getMessage();
   
    assertEquals( "foo", message );
View Full Code Here

Examples of com.eclipsesource.jaxrs.consumer.internal.RequestError

    assertEquals( "foo", message );
  }
 
  @Test
  public void testHasEntity() {
    RequestError error = mock( RequestError.class );
    when( error.getEntity() ).thenReturn( "foo" );
    RequestException exception = new RequestException( error );
   
    String entity = exception.getEntity();
   
    assertEquals( "foo", entity );
View Full Code Here

Examples of com.eclipsesource.jaxrs.consumer.internal.RequestError

    assertEquals( "foo", entity );
  }
 
  @Test
  public void testHasMethod() {
    RequestError error = mock( RequestError.class );
    when( error.getMethod() ).thenReturn( "foo" );
    RequestException exception = new RequestException( error );
   
    String method = exception.getMethod();
   
    assertEquals( "foo", method );
View Full Code Here

Examples of com.eclipsesource.jaxrs.consumer.internal.RequestError

    assertEquals( "foo", method );
  }
 
  @Test
  public void testHasUrl() {
    RequestError error = mock( RequestError.class );
    when( error.getRequestUrl() ).thenReturn( "foo" );
    RequestException exception = new RequestException( error );
   
    String url = exception.getRequestUrl();
   
    assertEquals( "foo", url );
View Full Code Here

Examples of com.eclipsesource.jaxrs.consumer.internal.RequestError

  }
 
  @Test
  @SuppressWarnings( { "rawtypes", "unchecked" } )
  public void testHasHeaders() {
    RequestError error = mock( RequestError.class );
    when( error.getRequestUrl() ).thenReturn( "foo" );
    MultivaluedMap headers = mock( MultivaluedMap.class );
    when( error.getHeaders() ).thenReturn( headers );
    RequestException exception = new RequestException( error );
   
    MultivaluedMap<String, Object> actualHeaders = exception.getHeaders();
   
    assertSame( headers, actualHeaders );
View Full Code Here

Examples of org.gsm.oneapi.responsebean.RequestError

            response=smsSendResponseProcessor.getResponse(con, OneAPIServlet.CREATED);
    } catch (Exception e) {
      response.setHTTPResponseCode(responseCode);
      response.setContentType(contentType);
     
      response.setRequestError(new RequestError(RequestError.SERVICEEXCEPTION, "SVCJAVA", e.getMessage(), e.getClass().getName()));

      logger.error("Exception "+e.getMessage()+" "+e.getLocalizedMessage());
    }         
    return response;
  }
View Full Code Here

Examples of org.gsm.oneapi.responsebean.RequestError

        logger.error("Exception "+e.getMessage()+" "+e.getLocalizedMessage());
        e.printStackTrace();
        response.setHTTPResponseCode(responseCode);
        response.setContentType(contentType);
       
        response.setRequestError(new RequestError(RequestError.SERVICEEXCEPTION, "SVCJAVA", e.getMessage(), e.getClass().getName()));
      }
    }
    return response;
  }
View Full Code Here

Examples of org.gsm.oneapi.responsebean.RequestError

              response=smsDeliveryReceiptSubscriptionProcessor.getResponse(con, OneAPIServlet.CREATED);
      } catch (Exception e) {
        response.setHTTPResponseCode(responseCode);
        response.setContentType(contentType);
       
        response.setRequestError(new RequestError(RequestError.SERVICEEXCEPTION, "SVCJAVA", e.getMessage(), e.getClass().getName()));
        logger.error("Exception "+e.getMessage()+" "+e.getLocalizedMessage());
      }
    }
    return response;
  }
View Full Code Here

Examples of org.gsm.oneapi.responsebean.RequestError

   * @param errorInformation
   */
  public static void sendError(HttpServletResponse response, int errorCode, int errorType, String messageId, String errorText, String errorInformation) {
    response.setContentType("application/json");
   
    RequestError error=new RequestError(errorType, messageId, errorText, errorInformation);
   
    ObjectMapper mapper=new ObjectMapper();     
    String jsonResponse=null;
    try {
      jsonResponse = "{\"requestError\":"+mapper.writeValueAsString(error)+"}";
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.