Examples of RequestResult


Examples of org.springframework.data.neo4j.rest.RequestResult

        Assert.assertEquals( 1, touched );
    }

    @Test
    public void shouldWorkWithThirdPartyJaxrs() throws Exception {
        RequestResult requestResult = sendRequest( "testNoContext" );

        Assert.assertEquals( 204, requestResult.getStatus() );
    }
View Full Code Here

Examples of org.springframework.data.neo4j.rest.RequestResult

        person = persistedPerson("Michael", 35);
    }

    @Test
    public void testGetFriends() throws IOException {
        final RequestResult requestResult = RequestResult.extractFrom(createRequest("ext/TestServerPlugin/graphdb/person").post(ClientResponse.class, "{\"name\":\"" + person.getName() + "\"}"));
        assertEquals(200, requestResult.getStatus());
        final String result = requestResult.getEntity();
        final Map data = (Map) new ObjectMapper().readValue(result, Object.class);
        assertEquals(person.getName(),((Map)data.get("data")).get("name"));

    }
View Full Code Here

Examples of org.springframework.data.neo4j.rest.RequestResult

    public boolean existsForNodes( String indexName ) {
        return indexInfo( "node" ).containsKey( indexName );
    }

    private Map<String, ?> indexInfo( final String indexType ) {
        RequestResult requestResult = restRequest.get( "index/" + indexType );
        if ( restRequest.statusIs(requestResult, javax.ws.rs.core.Response.Status.NO_CONTENT ) ) return Collections.emptyMap();
        return (Map<String, ?>) restRequest.toMap(requestResult);
    }
View Full Code Here

Examples of zendeskapi.RequestResult

   * @throws ZendeskApiException
   */
  public boolean markAuditAsTrusted(long ticketId, long auditId) throws ZendeskApiException {
    String resource = "tickets/" + ticketId + "/audits/" + auditId + "/trust.json";
    try {
      RequestResult res = runRequest(resource, RequestMethod.PUT, RequestResult.class);
      return res.isOk();
    } catch (Exception e) {
      throw new ZendeskApiException(e);
    }
  }
View Full Code Here

Examples of zendeskapi.RequestResult

   * @throws ZendeskApiException
   */
  public boolean recoverSuspendedTicket(long id) throws ZendeskApiException {
    String resource = "suspended_tickets/" + id + "/recover.json";
    try {
      RequestResult res = runRequest(resource, RequestMethod.PUT, RequestResult.class);
      return res.getHttpStatusCode() == HttpURLConnection.HTTP_OK;
    } catch (Exception e) {
      throw new ZendeskApiException(e);
    }
  }
View Full Code Here

Examples of zendeskapi.RequestResult

    for (Long id : ids) {
      sb.append(id).append(",");
    }
    String resource = "suspended_tickets/recover_many.json?ids=" + sb.toString();
    try {
      RequestResult res = runRequest(resource, RequestMethod.PUT, RequestResult.class);
      return res.getHttpStatusCode() == HttpURLConnection.HTTP_OK;
    } catch (Exception e) {
      throw new ZendeskApiException(e);
    }
  }
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.