@Test public void getPatientAccess() throws ComponentLookupException { ComponentManager cm = this.mocker.getInstance(ComponentManager.class, "context"); Patient patient = mock(Patient.class); EntityAccessHelper helper = mock(EntityAccessHelper.class); when(cm.getInstance(EntityAccessHelper.class)).thenReturn(helper); PatientAccess result = this.mocker.getComponentUnderTest().getPatientAccess(patient); Assert.assertNotNull(result); Assert.assertTrue(result instanceof DefaultPatientAccess); }
@Override public PatientAccess getPatientAccess(Patient targetPatient) { return new DefaultPatientAccess(targetPatient, getHelper(), this.accessManager, this.visibilityManager); }
DefaultPermissionsManager implements PermissionsManager { @Override public PatientAccess getPatientAccess(Patient targetPatient) { return new DefaultPatientAccess(targetPatient, getHelper(), this.accessManager, this.visibilityManager); } }
DefaultPermissionsManager implements PermissionsManager { @Override public PatientAccess getPatientAccess(Patient targetPatient) { return new DefaultPatientAccess(targetPatient, getHelper(), this.accessManager, this.visibilityManager); }  }
DefaultPermissionsManager implements PermissionsManager { @Override public PatientAccess getPatientAccess(Patient targetPatient) { return new DefaultPatientAccess(targetPatient, getHelper(), this.accessManager, this.visibilityManager); }  @Override Collection<Visibility> listVisibilityOptions(); @Override Collection<Visibility> listAllVisibilityOptions(); @Override Visibility getDefaultVisibility(); @Override Visibility resolveVisibility(String name); @Override Collection<AccessLevel> listAccessLevels(); @Override AccessLevel resolveAccessLevel(String name); @Override PatientAccess getPatientAccess(Patient targetPatient); @Override Collection<Patient> filterByVisibility(Collection<Patient> patients, Visibility requiredVisibility); @Override Iterator<Patient> filterByVisibility(Iterator<Patient> patients, Visibility requiredVisibility); void fireRightsUpdateEvent(String patientId); }
DefaultPermissionsManager implements PermissionsManager { @Override public PatientAccess getPatientAccess(Patient targetPatient) { return new DefaultPatientAccess(targetPatient, getHelper(), this.accessManager, this.visibilityManager); }  @Override Collection<Visibility> listVisibilityOptions(); @Override Collection<Visibility> listAllVisibilityOptions(); @Override Visibility getDefaultVisibility(); @Override Visibility resolveVisibility(String name); @Override Collection<AccessLevel> listAccessLevels(); @Override AccessLevel resolveAccessLevel(String name); @Override PatientAccess getPatientAccess(Patient targetPatient); @Override Collection<Patient> filterByVisibility(Collection<Patient> patients, Visibility requiredVisibility); @Override Iterator<Patient> filterByVisibility(Iterator<Patient> patients, Visibility requiredVisibility); void fireRightsUpdateEvent(String patientId);  }