@Test public void testExecuteSingleRelation() throws Exception { JsonApiDocument jsonApiDocument = new JsonApiDocument(); MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<>(); queryParams.put(INCLUDE, Collections.singletonList("children")); includedProcessor.execute(jsonApiDocument, parentRecord1, Optional.of(queryParams)); List<Resource> expectedIncluded = Collections.singletonList(childRecord1.toResource()); List<Resource> actualIncluded = jsonApiDocument.getIncluded(); assertEquals(expectedIncluded, actualIncluded, "Included Processor added single requested resource from 'include' query param"); }
@Override public void execute(JsonApiDocument jsonApiDocument, PersistentResource resource, Optional<MultivaluedMap<String, String>> queryParams) { if (isPresent(queryParams, INCLUDE)) { addIncludedResources(jsonApiDocument, resource, queryParams.get().get(INCLUDE)); } }
IncludedProcessor implements DocumentProcessor { @Override public void execute(JsonApiDocument jsonApiDocument, PersistentResource resource, Optional<MultivaluedMap<String, String>> queryParams) { if (isPresent(queryParams, INCLUDE)) { addIncludedResources(jsonApiDocument, resource, queryParams.get().get(INCLUDE)); } } }
IncludedProcessor implements DocumentProcessor { @Override public void execute(JsonApiDocument jsonApiDocument, PersistentResource resource, Optional<MultivaluedMap<String, String>> queryParams) { if (isPresent(queryParams, INCLUDE)) { addIncludedResources(jsonApiDocument, resource, queryParams.get().get(INCLUDE)); } }  }
IncludedProcessor implements DocumentProcessor { @Override public void execute(JsonApiDocument jsonApiDocument, PersistentResource resource, Optional<MultivaluedMap<String, String>> queryParams) { if (isPresent(queryParams, INCLUDE)) { addIncludedResources(jsonApiDocument, resource, queryParams.get().get(INCLUDE)); } }  @Override void execute(JsonApiDocument jsonApiDocument, PersistentResource resource,
                        Optional<MultivaluedMap<String, String>> queryParams); @Override void execute(JsonApiDocument jsonApiDocument, Set<PersistentResource> resources,
                        Optional<MultivaluedMap<String, String>> queryParams); }
IncludedProcessor implements DocumentProcessor { @Override public void execute(JsonApiDocument jsonApiDocument, PersistentResource resource, Optional<MultivaluedMap<String, String>> queryParams) { if (isPresent(queryParams, INCLUDE)) { addIncludedResources(jsonApiDocument, resource, queryParams.get().get(INCLUDE)); } }  @Override void execute(JsonApiDocument jsonApiDocument, PersistentResource resource,
                        Optional<MultivaluedMap<String, String>> queryParams); @Override void execute(JsonApiDocument jsonApiDocument, Set<PersistentResource> resources,
                        Optional<MultivaluedMap<String, String>> queryParams);  }