@Test public void getAllConsentsForPatientCatchesExceptionsAndReturnsNull() throws ComponentLookupException { when(this.consentManager.getAllConsentsForPatient("P0123456")).thenThrow(new NullPointerException()); Assert.assertNull(this.mocker.getComponentUnderTest().getAllConsentsForPatient("P0123456")); }
public JSONArray getAllConsentsForPatient(String patientId) { try { return this.consentManager.toJSON(this.consentManager.getAllConsentsForPatient(patientId)); } catch (Exception ex) { return null; } }
ConsentManagerScriptService implements ScriptService { public JSONArray getAllConsentsForPatient(String patientId) { try { return this.consentManager.toJSON(this.consentManager.getAllConsentsForPatient(patientId)); } catch (Exception ex) { return null; } } }
ConsentManagerScriptService implements ScriptService { public JSONArray getAllConsentsForPatient(String patientId) { try { return this.consentManager.toJSON(this.consentManager.getAllConsentsForPatient(patientId)); } catch (Exception ex) { return null; } }  }
ConsentManagerScriptService implements ScriptService { public JSONArray getAllConsentsForPatient(String patientId) { try { return this.consentManager.toJSON(this.consentManager.getAllConsentsForPatient(patientId)); } catch (Exception ex) { return null; } }  boolean hasConsent(String patientId, String consentId); JSONArray getAllConsentsForPatient(String patientId); }
ConsentManagerScriptService implements ScriptService { public JSONArray getAllConsentsForPatient(String patientId) { try { return this.consentManager.toJSON(this.consentManager.getAllConsentsForPatient(patientId)); } catch (Exception ex) { return null; } }  boolean hasConsent(String patientId, String consentId); JSONArray getAllConsentsForPatient(String patientId);  }