use of com.couchbase.client.java.json.JsonObject in project couchbase-jvm-clients by couchbase.
the class GetProjectionIntegrationTest method attributes_hobbies_1_details_location_lat.
@IgnoreWhen(clusterTypes = ClusterType.MOCKED)
@Test
void attributes_hobbies_1_details_location_lat() {
JsonObject decoded = collection.get(DOC_ID, getOptions().project("attributes.hobbies[1].details.location.lat")).contentAsObject();
JsonArray arr = decoded.getObject("attributes").getArray("hobbies");
JsonObject obj = arr.getObject(0).getObject("details").getObject("location");
assertEquals(1, arr.size());
assertEquals(1, obj.size());
assertEquals(49.282730, obj.getNumber("lat").doubleValue(), 0.1);
assertEquals(1, decoded.size());
}
use of com.couchbase.client.java.json.JsonObject in project couchbase-jvm-clients by couchbase.
the class GetProjectionIntegrationTest method attributes_dimensions_height.
@Test
void attributes_dimensions_height() {
JsonObject decoded = collection.get(DOC_ID, getOptions().project("attributes.dimensions.height")).contentAsObject();
JsonObject obj = decoded.getObject("attributes").getObject("dimensions");
assertEquals(1, obj.size());
assertEquals(67, obj.getInt("height").intValue());
assertEquals(1, decoded.size());
}
use of com.couchbase.client.java.json.JsonObject in project couchbase-jvm-clients by couchbase.
the class GetProjectionIntegrationTest method attributes_hobbies_1_details_location.
@IgnoreWhen(clusterTypes = ClusterType.MOCKED)
@Test
void attributes_hobbies_1_details_location() {
JsonObject decoded = collection.get(DOC_ID, getOptions().project("attributes.hobbies[1].details.location")).contentAsObject();
JsonArray arr = decoded.getObject("attributes").getArray("hobbies");
JsonObject obj = arr.getObject(0).getObject("details").getObject("location");
assertEquals(1, arr.size());
assertEquals(2, obj.size());
assertEquals(1, decoded.size());
}
use of com.couchbase.client.java.json.JsonObject in project couchbase-jvm-clients by couchbase.
the class GetProjectionIntegrationTest method attributes.
@Test
void attributes() {
JsonObject decoded = collection.get(DOC_ID, getOptions().project("attributes")).contentAsObject();
JsonObject obj = decoded.getObject("attributes");
assertEquals(3, obj.size());
assertEquals(1, decoded.size());
}
use of com.couchbase.client.java.json.JsonObject in project couchbase-jvm-clients by couchbase.
the class GetProjectionIntegrationTest method age.
@Test
void age() {
JsonObject decoded = collection.get(DOC_ID, getOptions().project("age")).contentAsObject();
assertEquals(26, decoded.getInt("age").intValue());
assertEquals(1, decoded.size());
}
Aggregations