Examples of APIResponse


Examples of com.alu.e3.prov.restapi.model.ApiResponse

        try {
          apiService.create(api);
        } catch (ProvisionException e) {
          throw new WebApplicationException(e);
        }
        return new ApiResponse(ApiResponse.SUCCESS, api.getId());
      }
    };

    return execute(action, (Object) null);
   
View Full Code Here

Examples of com.atlauncher.data.APIResponse

            ).get();
            Map<String, Object> request = new HashMap<String, Object>();
            request.put("issue", new GithubIssue(title, body));

            try {
                APIResponse response = Settings.gson.fromJson(Utils.sendAPICall("githubissue/", request),
                        APIResponse.class);
                if (!response.wasError() && response.getDataAsInt() != 0) {
                    LogManager.info("Exception reported to GitHub. Track/comment on the issue at " + response
                            .getDataAsString());
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
View Full Code Here

Examples of com.cloudinary.Api.ApiResponse

  }
 
  @Test
  public void testApiLimits() throws Exception {
    // should support reporting the current API limits found in the response header
    ApiResponse result1 = api.transformations(Cloudinary.emptyMap());
    ApiResponse result2 = api.transformations(Cloudinary.emptyMap());
    assertNotNull(result1.apiRateLimit());
    assertNotNull(result2.apiRateLimit());
    assertEquals(result1.apiRateLimit().getRemaining() - 1, result2.apiRateLimit().getRemaining());
    assertTrue(result2.apiRateLimit().getLimit() > result2.apiRateLimit().getRemaining());
    assertEquals(result1.apiRateLimit().getLimit(), result2.apiRateLimit().getLimit());
    assertEquals(result1.apiRateLimit().getReset(), result2.apiRateLimit().getReset());
    assertTrue(result2.apiRateLimit().getReset().after(new java.util.Date()));
  }
View Full Code Here

Examples of com.google.api.explorer.client.base.ApiResponse

  }

  /** This is necessary because history item cannot be subclassed. */
  private HistoryItem createEmptyHistoryItem() {
    ApiRequest mockRequest = EasyMock.createMock(ApiRequest.class);
    ApiResponse mockResponse = EasyMock.createMock(ApiResponse.class);
    return new HistoryItem("1", mockRequest, mockResponse, 0, 0);
  }
View Full Code Here

Examples of com.wordnik.swagger.sample.model.ApiResponse

    exception.printStackTrace();
    if (exception instanceof javax.ws.rs.WebApplicationException) {
      javax.ws.rs.WebApplicationException e = (javax.ws.rs.WebApplicationException) exception;
      return Response
          .status(e.getResponse().getStatus())
          .entity(new ApiResponse(e.getResponse().getStatus(),
              exception.getMessage())).build();
    } else if (exception instanceof com.fasterxml.jackson.core.JsonParseException) {
      return Response.status(400)
          .entity(new ApiResponse(400, "bad input")).build();
    } else if (exception instanceof NotFoundException) {
      return Response
          .status(Status.NOT_FOUND)
          .entity(new ApiResponse(ApiResponse.ERROR, exception
              .getMessage())).build();
    } else if (exception instanceof BadRequestException) {
      return Response
          .status(Status.BAD_REQUEST)
          .entity(new ApiResponse(ApiResponse.ERROR, exception
              .getMessage())).build();
    } else if (exception instanceof ApiException) {
      return Response
          .status(Status.BAD_REQUEST)
          .entity(new ApiResponse(ApiResponse.ERROR, exception
              .getMessage())).build();
    } else {
      return Response.status(500)
          .entity(new ApiResponse(500, "something bad happened"))
          .build();
    }
  }
View Full Code Here

Examples of de.devbliss.apitester.ApiResponse

        return apiTest.get(uri);
    }

    protected ApiResponse makeGetRequest(URI uri) throws Exception {
        sayUri(uri, HTTP_REQUEST.GET);
        ApiResponse response = makeGetRequestSilent(uri);
        docTest.sayResponse(response.httpStatus, response.payload);
        return response;
    }
View Full Code Here

Examples of de.devbliss.apitester.ApiResponse

        return makePostRequest(uri, null);
    }

    protected ApiResponse makePostRequest(URI uri, Object obj) throws Exception {
        sayUri(uri, obj, HTTP_REQUEST.POST);
        ApiResponse response = makePostRequestSilent(uri, obj);
        docTest.sayResponse(response.httpStatus, response.payload);
        return response;
    }
View Full Code Here

Examples of de.devbliss.apitester.ApiResponse

        return makePutRequest(uri, null);
    }

    protected ApiResponse makePutRequest(URI uri, Object obj) throws Exception {
        sayUri(uri, obj, HTTP_REQUEST.PUT);
        ApiResponse response = makePutRequestSilent(uri, obj);
        docTest.sayResponse(response.httpStatus, response.payload);
        return response;
    }
View Full Code Here

Examples of de.devbliss.apitester.ApiResponse

        return makeDeleteRequest(uri, null);
    }

    protected ApiResponse makeDeleteRequest(URI uri, Object obj) throws Exception {
        sayUri(uri, HTTP_REQUEST.DELETE);
        ApiResponse response = makeDeleteRequestSilent(uri, obj);
        docTest.sayResponse(response.httpStatus, response.payload);
        return response;
    }
View Full Code Here

Examples of gwtappcontainer.shared.apis.APIResponse

   
    ContentAPI api = new ContentAPI();
    String tag = "tag_" + UUID.randomUUID();
   
    User user = UserServiceFactory.getUserService().getCurrentUser();
    APIResponse resp = api.addNewTag(tag, user);
    assertTrue(resp.statusCode == Status.SUCCESS);
   
    resp = api.getAllTags();
    assertTrue(resp.statusCode == Status.SUCCESS);
   
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.