Examples of ApiRequest


Examples of com.cosmicpush.app.domain.requests.ApiRequest

  @POST
  @Path("/{apiRequestId}/resend")
  public Response resendEmailMessage(@Context ServletContext context, @PathParam("apiRequestId") String apiRequestId) throws Exception {

    ApiRequest apiRequest = config.getApiRequestStore().getByApiRequestId(apiRequestId);
    EmailPush push = (EmailPush)apiRequest.getPush();

    if (useAwsEmail()) {
      new AwsEmailDelegate(config.getObjectMapper(), config.getApiRequestStore(), account, apiClient, apiRequest, push).resend();

    } else {
      new SmtpEmailDelegate(config.getObjectMapper(), config.getApiRequestStore(), account, apiClient, apiRequest, push).resend();
    }

    // Do not use the old References - they need to be reloaded.
    apiRequest = config.getApiRequestStore().getByApiRequestId(apiRequestId);
    push = (EmailPush)apiRequest.getPush();

    EmailModel model = new EmailModel(account, apiClient, apiRequest, push);

    String path = String.format("%s/manage/api-client/%s/emails/%s", context.getContextPath(), apiClient.getClientName(), apiRequest.getApiRequestId());
    return Response.seeOther(new URI(path)).build();
  }
View Full Code Here

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

  private Map<String, String> headers = ImmutableMap.of("Content-Type", "application/json");
  private HttpMethod method = HttpMethod.POST;


  public void testRequestParameters() {
    ApiRequest req = generateRequest(path, body, headers, method);

    DynamicJso obj = (DynamicJso) CrossDomainRequest.convertRequest(req);

    assertEquals(path, obj.getString("url"));
    assertEquals(body, obj.getString("body"));
View Full Code Here

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

   * Test whether setting the base path has an effect. It shouldn't.
   */
  public void testAlternateBase() {
    Config.setBaseUrl("https://www.googleapis.com/alternate/base/path");

    ApiRequest req = generateRequest(path, body, headers, method);

    DynamicJso obj = (DynamicJso) CrossDomainRequest.convertRequest(req);

    assertEquals(path, obj.getString("url"));
    assertEquals(body, obj.getString("body"));
View Full Code Here

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

  }

  private ApiRequest generateRequest(final String path, final String body,
      final Map<String, String> headers, final HttpMethod method) {

    return new ApiRequest() {

      @Override
      public String getRequestBody() {
        return body;
      }
View Full Code Here

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

    EasyMock.verify(event, analyticsManager, historyCache, delegate);
  }

  /** 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.google.api.explorer.client.base.ApiRequest

   */
  private void populateHistoryItems(
      final String prefix, Iterable<HistoryItem> historyItems, EntryAggregatorView aggregator) {

    for (final HistoryItem item : historyItems) {
      ApiRequest request = item.getRequest();
      HasClickHandlers rowHandler = aggregator.addEntry(new HistoryEntry(request.getMethod()
          .getId(), request.getHttpMethod().toString() + " " + request.getRequestPath(), item
          .getEndTime()));
      rowHandler.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
          presenter.handleClickHistoryItem(prefix, item);
View Full Code Here

Examples of com.vmware.bdd.plugin.ambari.api.model.cluster.ApiRequest

      AmbariImpl spy = Mockito.spy(provider);
      AmbariManagerClientbuilder clientbuilder = makeClientBuilder();
      ApiManager apiManager = new FakeApiManager(clientbuilder) {
         @Override
         public ApiRequest stopAllServicesInCluster(String clusterName) throws AmbariApiException {
            ApiRequest apiRequest = new ApiRequest();
            apiRequest.setApiRequestInfo(new ApiRequestInfo());
            return apiRequest;
         }
      };

      Mockito.when(spy.isProvisioned(blueprint.getName())).thenReturn(true);
View Full Code Here

Examples of com.vmware.bdd.plugin.ambari.api.model.cluster.ApiRequest

      AmbariManagerClientbuilder clientbuilder = makeClientBuilder();
      ApiManager apiManager = new FakeApiManager(clientbuilder) {
         @Override
         public ApiRequest startAllServicesInCluster(String clusterName) throws AmbariApiException {
            ApiRequest apiRequest = new ApiRequest();
            apiRequest.setApiRequestInfo(new ApiRequestInfo());
            return apiRequest;
         }
      };
      try {
         Mockito.when(spy.doSoftwareOperation(Mockito.anyString(), Mockito.<ApiRequest>any(),
View Full Code Here

Examples of com.vmware.bdd.plugin.ambari.api.model.cluster.ApiRequest

      ClusterReport clusterReport = new ClusterReport(blueprint);
      AmbariImpl spy = Mockito.spy(provider);
      ApiManager apiManager = new FakeApiManager(makeClientBuilder());
      ApiManager backup = spy.getApiManager();
      spy.setApiManager(apiManager);
      ApiRequest request = new ApiRequest();
      ApiRequestInfo requestInfo = new ApiRequestInfo();
      request.setApiRequestInfo(requestInfo);
      try {
         spy.doSoftwareOperation(blueprint.getName(), request, clusterReport, reportQueue);
      } catch (Exception e) {
         e.printStackTrace();
         Assert.assertTrue(e.getMessage().contains("Failed to execute request: "));
View Full Code Here

Examples of com.vmware.bdd.plugin.ambari.api.model.cluster.ApiRequest

      Assert.assertTrue(!services.isEmpty());
   }

   @Test
   public void testStopAllServicesInCluster() throws Exception {
      ApiRequest apiRequest = apiManager.stopAllServicesInCluster(clusterName);
      Assert.assertNotNull(apiRequest);
   }
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.