@Test public void listAccessLevels() throws ComponentLookupException { List<AccessLevel> levels = new ArrayList<>(); levels.add(this.view); levels.add(this.edit); levels.add(this.manage); when(this.entityPermissionsManager.listAccessLevels()).thenReturn(levels); Collection<AccessLevel> returnedLevels = this.mocker.getComponentUnderTest().listAccessLevels(); Assert.assertEquals(3, returnedLevels.size()); Iterator<AccessLevel> it = returnedLevels.iterator(); Assert.assertSame(this.view, it.next()); Assert.assertSame(this.edit, it.next()); Assert.assertSame(this.manage, it.next()); Assert.assertFalse(returnedLevels.contains(this.none)); Assert.assertFalse(returnedLevels.contains(this.owner)); }
@Override public Collection<AccessLevel> listAccessLevels() { return this.entityPermissionsManager.listAccessLevels(); }
DefaultPermissionsManager implements PermissionsManager { @Override public Collection<AccessLevel> listAccessLevels() { return this.entityPermissionsManager.listAccessLevels(); } }
DefaultPermissionsManager implements PermissionsManager { @Override public Collection<AccessLevel> listAccessLevels() { return this.entityPermissionsManager.listAccessLevels(); }  }
DefaultPermissionsManager implements PermissionsManager { @Override public Collection<AccessLevel> listAccessLevels() { return this.entityPermissionsManager.listAccessLevels(); }  @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 Collection<AccessLevel> listAccessLevels() { return this.entityPermissionsManager.listAccessLevels(); }  @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);  }