@Test public void getReturnsTheLanguagesOfTheDocumentsWrittenByAPerson() throws InvalidCollectionException, NotFoundException { UUID pers1Id = UUID.randomUUID(); TinkerPopGraphManager graphManager = newGraph() .withVertex("work1", v -> v.withOutgoingRelation("isCreatedBy", "pers1", r -> r.withIsLatest(true).withAccepted("wwrelation", true)) .withOutgoingRelation("hasWorkLanguage", "lang1", r -> r.withIsLatest(true).withAccepted("wwrelation", true)) .withVre("ww") .withVre("") .withType("document") .isLatest(true) .withTimId(UUID.randomUUID().toString()) ) .withVertex("work2", v -> v.withOutgoingRelation("isCreatedBy", "pers1", r -> r.withIsLatest(true).withAccepted("wwrelation", true)) .withOutgoingRelation("hasWorkLanguage", "lang2", r -> r.withIsLatest(true).withAccepted("wwrelation", true)) .withVre("ww") .withVre("") .withType("document") .isLatest(true) .withTimId(UUID.randomUUID().toString()) ) .withVertex("pers1", v -> v.withVre("ww") .withVre("") .withType("person") .withProperty("displayName", "author1") .withProperty("wwperson_gender", "FEMALE") .isLatest(true) .withTimId(pers1Id.toString()) ) .withVertex("lang1", v -> v.withVre("ww") .withVre("") .withType("language") .withProperty("wwlanguage_name", "French") .isLatest(true) .withTimId(UUID.randomUUID().toString()) ) .withVertex("lang2", v -> v.withVre("ww") .withVre("") .withType("language") .withProperty("wwlanguage_name", "Dutch") .isLatest(true) .withTimId(UUID.randomUUID().toString()) ) .withVertex("relationType1", v -> v.withType("relationType") .withVre("") .withProperty("relationtype_regularName", "isCreatedBy") .withProperty("relationtype_inverseName", "isCreatorOf") ) .withVertex("relationType2", v -> v.withType("relationType") .withVre("") .withProperty("relationtype_regularName", "hasWorkLanguage") .withProperty("relationtype_inverseName", "isWorkLanguageOf") ) .wrap(); WomenWritersJsonCrudService instance = createInstance(graphManager); JsonNode result = instance.get("wwpersons", pers1Id); assertThat(result.toString(), sameJSONAs( jsnO("@authorLanguages", jsnA(jsn("French"), jsn("Dutch"))).toString() ).allowingAnyArrayOrdering().allowingExtraUnexpectedFields()); }
public JsonNode get(String collectionName, UUID id) throws InvalidCollectionException, NotFoundException { return get(collectionName, id, null); }
WomenWritersJsonCrudService { public JsonNode get(String collectionName, UUID id) throws InvalidCollectionException, NotFoundException { return get(collectionName, id, null); } }
WomenWritersJsonCrudService { public JsonNode get(String collectionName, UUID id) throws InvalidCollectionException, NotFoundException { return get(collectionName, id, null); } WomenWritersJsonCrudService(Vres mappings,
                                     UserValidator userValidator,
                                     UrlGenerator relationUrlFor,
                                     TimbuctooActions timDbAccess); }
WomenWritersJsonCrudService { public JsonNode get(String collectionName, UUID id) throws InvalidCollectionException, NotFoundException { return get(collectionName, id, null); } WomenWritersJsonCrudService(Vres mappings,
                                     UserValidator userValidator,
                                     UrlGenerator relationUrlFor,
                                     TimbuctooActions timDbAccess); JsonNode get(String collectionName, UUID id); JsonNode get(String collectionName, UUID id, Integer rev); }
WomenWritersJsonCrudService { public JsonNode get(String collectionName, UUID id) throws InvalidCollectionException, NotFoundException { return get(collectionName, id, null); } WomenWritersJsonCrudService(Vres mappings,
                                     UserValidator userValidator,
                                     UrlGenerator relationUrlFor,
                                     TimbuctooActions timDbAccess); JsonNode get(String collectionName, UUID id); JsonNode get(String collectionName, UUID id, Integer rev); static final Logger LOG; }