@Test public void getPatientGeneCountsPatientIdIsNull() { final Response response = this.component.getPatientGeneCounts(null, false, false); verify(this.logger).error("No patient ID was provided."); Assert.assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatus()); }
@Override public Response getPatientGeneCounts( final String patientId, final boolean excludeRejectedGenes, final boolean withMatchCount) { if (StringUtils.isBlank(patientId)) { this.slf4Jlogger.error("No patient ID was provided."); return Response.status(Response.Status.BAD_REQUEST).build(); } try { final Patient patient = this.repository.get(patientId); if (patient == null) { this.slf4Jlogger.error("Could not find patient with ID {}", patientId); return Response.status(Response.Status.NOT_FOUND).build(); } final JSONObject genePanel = this.genePanelFactory.withMatchCount(withMatchCount) .build(patient, excludeRejectedGenes).toJSON(); return Response.ok(genePanel, MediaType.APPLICATION_JSON_TYPE).build(); } catch (final SecurityException ex) { this.slf4Jlogger.error("View access denied on patient record [{}]: {}", patientId, ex.getMessage()); return Response.status(Response.Status.UNAUTHORIZED).build(); } }
DefaultGenePanelsPatientResourceImpl extends XWikiResource implements GenePanelsPatientResource { @Override public Response getPatientGeneCounts( final String patientId, final boolean excludeRejectedGenes, final boolean withMatchCount) { if (StringUtils.isBlank(patientId)) { this.slf4Jlogger.error("No patient ID was provided."); return Response.status(Response.Status.BAD_REQUEST).build(); } try { final Patient patient = this.repository.get(patientId); if (patient == null) { this.slf4Jlogger.error("Could not find patient with ID {}", patientId); return Response.status(Response.Status.NOT_FOUND).build(); } final JSONObject genePanel = this.genePanelFactory.withMatchCount(withMatchCount) .build(patient, excludeRejectedGenes).toJSON(); return Response.ok(genePanel, MediaType.APPLICATION_JSON_TYPE).build(); } catch (final SecurityException ex) { this.slf4Jlogger.error("View access denied on patient record [{}]: {}", patientId, ex.getMessage()); return Response.status(Response.Status.UNAUTHORIZED).build(); } } }
DefaultGenePanelsPatientResourceImpl extends XWikiResource implements GenePanelsPatientResource { @Override public Response getPatientGeneCounts( final String patientId, final boolean excludeRejectedGenes, final boolean withMatchCount) { if (StringUtils.isBlank(patientId)) { this.slf4Jlogger.error("No patient ID was provided."); return Response.status(Response.Status.BAD_REQUEST).build(); } try { final Patient patient = this.repository.get(patientId); if (patient == null) { this.slf4Jlogger.error("Could not find patient with ID {}", patientId); return Response.status(Response.Status.NOT_FOUND).build(); } final JSONObject genePanel = this.genePanelFactory.withMatchCount(withMatchCount) .build(patient, excludeRejectedGenes).toJSON(); return Response.ok(genePanel, MediaType.APPLICATION_JSON_TYPE).build(); } catch (final SecurityException ex) { this.slf4Jlogger.error("View access denied on patient record [{}]: {}", patientId, ex.getMessage()); return Response.status(Response.Status.UNAUTHORIZED).build(); } }  }
DefaultGenePanelsPatientResourceImpl extends XWikiResource implements GenePanelsPatientResource { @Override public Response getPatientGeneCounts( final String patientId, final boolean excludeRejectedGenes, final boolean withMatchCount) { if (StringUtils.isBlank(patientId)) { this.slf4Jlogger.error("No patient ID was provided."); return Response.status(Response.Status.BAD_REQUEST).build(); } try { final Patient patient = this.repository.get(patientId); if (patient == null) { this.slf4Jlogger.error("Could not find patient with ID {}", patientId); return Response.status(Response.Status.NOT_FOUND).build(); } final JSONObject genePanel = this.genePanelFactory.withMatchCount(withMatchCount) .build(patient, excludeRejectedGenes).toJSON(); return Response.ok(genePanel, MediaType.APPLICATION_JSON_TYPE).build(); } catch (final SecurityException ex) { this.slf4Jlogger.error("View access denied on patient record [{}]: {}", patientId, ex.getMessage()); return Response.status(Response.Status.UNAUTHORIZED).build(); } }  @Override Response getPatientGeneCounts(
        final String patientId,
        final boolean excludeRejectedGenes,
        final boolean withMatchCount); }
DefaultGenePanelsPatientResourceImpl extends XWikiResource implements GenePanelsPatientResource { @Override public Response getPatientGeneCounts( final String patientId, final boolean excludeRejectedGenes, final boolean withMatchCount) { if (StringUtils.isBlank(patientId)) { this.slf4Jlogger.error("No patient ID was provided."); return Response.status(Response.Status.BAD_REQUEST).build(); } try { final Patient patient = this.repository.get(patientId); if (patient == null) { this.slf4Jlogger.error("Could not find patient with ID {}", patientId); return Response.status(Response.Status.NOT_FOUND).build(); } final JSONObject genePanel = this.genePanelFactory.withMatchCount(withMatchCount) .build(patient, excludeRejectedGenes).toJSON(); return Response.ok(genePanel, MediaType.APPLICATION_JSON_TYPE).build(); } catch (final SecurityException ex) { this.slf4Jlogger.error("View access denied on patient record [{}]: {}", patientId, ex.getMessage()); return Response.status(Response.Status.UNAUTHORIZED).build(); } }  @Override Response getPatientGeneCounts(
        final String patientId,
        final boolean excludeRejectedGenes,
        final boolean withMatchCount);  }