@Test public void getAllConsentsForPatientForwardsCalls() throws ComponentLookupException { Set<Consent> consents = new LinkedHashSet<>(); consents.add(this.consent1); consents.add(this.consent2); when(this.consentManager.getAllConsentsForPatient("P0123456")).thenReturn(consents); JSONArray result = new JSONArray(); when(this.consentManager.toJSON(consents)).thenReturn(result); Assert.assertSame(result, 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);  }