Package io.teknek.intravert.client

Examples of io.teknek.intravert.client.Client.post()


                     .withId("2")
                    .withType(ActionFactory.SET_KEYSPACE)
                    .withArguments(
                            new ImmutableMap.Builder<String, Object>().put("name", "bla").build()));
    Client cl = new Client();
    Response response = cl.post("http://127.0.0.1:7654", request);
    List<Map> results = (List<Map>) response.getResults().get("1");
    Assert.assertNotNull(results.get(0).get(Constants.SESSION_ID));
  }
}
/*
 
View Full Code Here


    filterDef.put("scope", "application");
    filterDef.put("script", "{ row -> if (row['value'].toInteger() > 21) return row else return null }");
    request.getOperations().add(new Operation()
    .withId("1").withType(ActionFactory.CREATE_FILTER).withArguments(filterDef));
    Client cl = new Client();
    Response response = cl.post("http://127.0.0.1:7654", request);
    List<Map> results = (List<Map>) response.getResults().get("1");
    Assert.assertEquals(new ImmutableMap.Builder<String, Object>().put("result", "ok").build(), results.get(0));
  }
}
View Full Code Here

    File output = new File(testDir, "output.json");
    Client c = new Client();
    ObjectMapper om  = new ObjectMapper();
    om.configure(Feature.INDENT_OUTPUT, true);
    Request r = om.readValue(input, Request.class);
    Response resp = c.post("http://localhost:7654", r);
    Assert.assertEquals(new String(Files.readAllBytes(output.toPath())).trim(), om.writeValueAsString(resp).trim());
  }
 
  @Test
  public void putGetTest() throws JsonParseException, JsonMappingException, IOException{
View Full Code Here

            .put("columnFamily", "upsert").build()));
    Client cl = new Client();
    ObjectMapper om = new ObjectMapper();
    om.configure(Feature.INDENT_OUTPUT,true);
    System.out.println(om.writeValueAsString(request));
    Response response = cl.post("http://127.0.0.1:7654", request);
    List<Map> results = (List<Map>) response.getResults().get("1");
    Assert.assertEquals(new ImmutableMap.Builder<String, Object>().put("result", "ok").build(), results.get(0));
  }
}
/*
 
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.