@Test public void testNoQueryIncludeParams() throws Exception { JsonApiDocument jsonApiDocument = new JsonApiDocument(); MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<>(); queryParams.put("unused", Collections.emptyList()); includedProcessor.execute(jsonApiDocument, parentRecord1, Optional.of(queryParams)); assertNull(jsonApiDocument.getIncluded(), "Included Processor adds no resources when not given query params"); }
@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);  }