@Test public void resolveTermsNoTermIdsIncluded() { when(this.request.getProperties(TERM_ID)).thenReturn(Collections.emptyList()); final Response response = this.component.resolveTerms(); Assert.assertEquals(Response.Status.NO_CONTENT.getStatusCode(), response.getStatus()); verify(this.logger, times(1)).info("No content provided."); }
@Override public Response resolveTerms() { final Request request = this.container.getRequest(); final List<Object> termIds = request.getProperties(TERM_ID); if (CollectionUtils.isEmpty(termIds)) { this.slf4Jlogger.info("No content provided."); return Response.status(Response.Status.NO_CONTENT).build(); } this.slf4Jlogger.debug("Retrieving terms with IDs: [{}]", termIds); final JSONObject rep = new JSONObject() .put(ROWS, this.createRows(termIds)) .put(LINKS, this.autolinker.get().forResource(getClass(), this.uriInfo).build()); return Response.ok(rep, MediaType.APPLICATION_JSON_TYPE).build(); }
DefaultVocabularyTermsResolveResource extends XWikiResource implements VocabularyTermsResolveResource { @Override public Response resolveTerms() { final Request request = this.container.getRequest(); final List<Object> termIds = request.getProperties(TERM_ID); if (CollectionUtils.isEmpty(termIds)) { this.slf4Jlogger.info("No content provided."); return Response.status(Response.Status.NO_CONTENT).build(); } this.slf4Jlogger.debug("Retrieving terms with IDs: [{}]", termIds); final JSONObject rep = new JSONObject() .put(ROWS, this.createRows(termIds)) .put(LINKS, this.autolinker.get().forResource(getClass(), this.uriInfo).build()); return Response.ok(rep, MediaType.APPLICATION_JSON_TYPE).build(); } }
DefaultVocabularyTermsResolveResource extends XWikiResource implements VocabularyTermsResolveResource { @Override public Response resolveTerms() { final Request request = this.container.getRequest(); final List<Object> termIds = request.getProperties(TERM_ID); if (CollectionUtils.isEmpty(termIds)) { this.slf4Jlogger.info("No content provided."); return Response.status(Response.Status.NO_CONTENT).build(); } this.slf4Jlogger.debug("Retrieving terms with IDs: [{}]", termIds); final JSONObject rep = new JSONObject() .put(ROWS, this.createRows(termIds)) .put(LINKS, this.autolinker.get().forResource(getClass(), this.uriInfo).build()); return Response.ok(rep, MediaType.APPLICATION_JSON_TYPE).build(); }  }
DefaultVocabularyTermsResolveResource extends XWikiResource implements VocabularyTermsResolveResource { @Override public Response resolveTerms() { final Request request = this.container.getRequest(); final List<Object> termIds = request.getProperties(TERM_ID); if (CollectionUtils.isEmpty(termIds)) { this.slf4Jlogger.info("No content provided."); return Response.status(Response.Status.NO_CONTENT).build(); } this.slf4Jlogger.debug("Retrieving terms with IDs: [{}]", termIds); final JSONObject rep = new JSONObject() .put(ROWS, this.createRows(termIds)) .put(LINKS, this.autolinker.get().forResource(getClass(), this.uriInfo).build()); return Response.ok(rep, MediaType.APPLICATION_JSON_TYPE).build(); }  @Override Response resolveTerms(); }
DefaultVocabularyTermsResolveResource extends XWikiResource implements VocabularyTermsResolveResource { @Override public Response resolveTerms() { final Request request = this.container.getRequest(); final List<Object> termIds = request.getProperties(TERM_ID); if (CollectionUtils.isEmpty(termIds)) { this.slf4Jlogger.info("No content provided."); return Response.status(Response.Status.NO_CONTENT).build(); } this.slf4Jlogger.debug("Retrieving terms with IDs: [{}]", termIds); final JSONObject rep = new JSONObject() .put(ROWS, this.createRows(termIds)) .put(LINKS, this.autolinker.get().forResource(getClass(), this.uriInfo).build()); return Response.ok(rep, MediaType.APPLICATION_JSON_TYPE).build(); }  @Override Response resolveTerms();  }