### Question:
PropertiesBasedAccessController implements AccessController, OrganizationResolver, SubjectResolver, LifecycleAspect { @Override public Organization resolveOrganization(UUID id) { PropertiesOrganization organization = state.get().getOrganization(IdMapper.toInternalID(id)); return ObjectUtils.ifNotNull(organization, o -> createOrganization(id, o.getName())); } private  PropertiesBasedAccessController(String propertiesFile, long readingInterval); @Override SessionDescriptor validate(Credentials credentials); @Override boolean hasPermission(Credentials credentials, FunctionIdentity function); @Override boolean hasPermission(Credentials credentials, NamedFunction function); @Override boolean hasPermission(Credentials credentials, FunctionIdentity function, OrganizationIdentity organization); @Override boolean hasPermission(Credentials credentials, NamedFunction function, OrganizationIdentity organization); @Override Set<SubjectIdentity> getSubjectIdentities(Credentials credentials); @Override Set<OrganizationIdentity> getAvailableOrganizations(Credentials credentials); @Override Set<OrganizationIdentity> getDescendingOrganizations(Credentials credentials, OrganizationIdentity topLevelOrg); @Override Organization resolveOrganization(UUID id); @Override Organization resolveOrganization(String name); @Override Organization resolveCurrentUserAffiliation(Credentials credentials); @Override Subject resolveSubject(UUID id); @Override Subject resolveSubject(String name); @Override Subject resolveCurrentUser(Credentials credentials); @Override void startComponent(); @Override void stopComponent(); static Builder builder();  }### Answer:
@Test public void testResolveOrganizationNotExistingOrganization() throws Exception { setup("organization.1.name = organization"); assertNull(accessController.resolveOrganization(UUID.fromString("00000000-0000-0000-0000-000000000002"))); }
@Test public void testResolveOrganizationExistingOrganization() throws Exception { setup("organization.1.name = organization"); UUID id = UUID.fromString("00000000-0000-0000-0000-000000000001"); Organization organization = accessController.resolveOrganization(id); assertEquals(id, organization.getId()); assertEquals("organization", organization.getName()); }
@Test public void testResolveOrganizationByNameNotExistingOrganization() throws Exception { setup("organization.1.name = organization"); assertNull(accessController.resolveOrganization("something")); }
@Test public void testResolveOrganizationByNameExistingOrganization() throws Exception { setup("organization.1.name = organization"); Organization organization = accessController.resolveOrganization("organization"); assertEquals(UUID.fromString("00000000-0000-0000-0000-000000000001"), organization.getId()); assertEquals("organization", organization.getName()); }