MCPcopy Create free account
hub / github.com/dgraph-io/dgraph4j / testQuery3Quads

Method testQuery3Quads

src/test/java/io/dgraph/MutatesTest.java:48–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

46 }
47
48 @Test
49 public void testQuery3Quads() {
50 List<String> uids = Arrays.stream(data).map(d -> uidsMap.get(d)).collect(Collectors.toList());
51
52 String query = String.format("{ me(func: uid(%s)) { name }}", String.join(",", uids));
53 logger.debug("Query: {}\n", query);
54
55 Transaction txn = dgraphClient.newTransaction();
56 Response response = txn.query(query);
57 String res = response.getJson().toStringUtf8();
58 logger.debug("Response JSON: {}\n", res);
59
60 String expected =
61 "{\"me\":[{\"name\":\"ok 200\"},{\"name\":\"ok 300\"},{\"name\":\"ok 400\"}]}";
62 assertEquals(res, expected);
63 assertTrue(response.getTxn().getStartTs() > 0);
64 txn.discard();
65 }
66}

Callers

nothing calls this directly

Calls 3

queryMethod · 0.95
discardMethod · 0.95
newTransactionMethod · 0.45

Tested by

no test coverage detected