Skip to content

Commit

Permalink
Improve code readability
Browse files Browse the repository at this point in the history
  • Loading branch information
janderson2 committed Feb 22, 2022
1 parent d674ca7 commit 2b02f06
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import com.github.onsdigital.zebedee.servicetokens.store.ServiceStoreImpl;
import com.github.onsdigital.zebedee.session.service.JWTSessionsServiceImpl;
import com.github.onsdigital.zebedee.session.service.Sessions;
import com.github.onsdigital.zebedee.session.service.SessionsServiceImpl;
import com.github.onsdigital.zebedee.session.service.ThreadLocalSessionsServiceImpl;
import com.github.onsdigital.zebedee.session.store.SessionsStore;
import com.github.onsdigital.zebedee.session.store.SessionsStoreImpl;
Expand Down Expand Up @@ -92,7 +91,7 @@
import static com.github.onsdigital.zebedee.configuration.Configuration.getSlackToken;
import static com.github.onsdigital.zebedee.configuration.Configuration.isVerificationEnabled;
import static com.github.onsdigital.zebedee.configuration.Configuration.slackChannelsToNotfiyOnStartUp;
import static com.github.onsdigital.zebedee.permissions.store.PermissionsStoreFileSystemImpl.initialisePermissions;
import static com.github.onsdigital.zebedee.permissions.store.PermissionsStoreFileSystemImpl.initialiseAccessMapping;
import static org.apache.commons.lang3.StringUtils.isEmpty;

/**
Expand Down Expand Up @@ -312,7 +311,7 @@ private void initTeamsService(Path zebedeePath,
*/
private void initPermissionsService(Path zebedeePath, TeamsService teamsService) throws IOException {
Path permissionsPath = createDir(zebedeePath, PERMISSIONS);
initialisePermissions(permissionsPath);
initialiseAccessMapping(permissionsPath);

PermissionsStore permissionsStore = new PermissionsStoreFileSystemImpl(permissionsPath);
PermissionsServiceImpl legacyPermissionsService = new PermissionsServiceImpl(permissionsStore, this::getTeamsService);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class PermissionsStoreFileSystemImpl implements PermissionsStore {
* @param accessMappingPath the path of the accessMapping json file.
* @throws IOException error while initializing.
*/
public static void initialisePermissions(Path accessMappingPath) throws IOException {
public static void initialiseAccessMapping(Path accessMappingPath) throws IOException {
Path jsonPath = accessMappingPath.resolve(PERMISSIONS_FILE);

if (!Files.exists(jsonPath)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void tearDown() throws Exception {

@Test
public void constructor_ShouldCreateAccessMappingIfDoesNotExist() throws Exception {
PermissionsStoreFileSystemImpl.initialisePermissions(permissionsDir);
PermissionsStoreFileSystemImpl.initialiseAccessMapping(permissionsDir);
PermissionsStore store = new PermissionsStoreFileSystemImpl(permissionsDir);

assertThat(Files.exists(accessMappingPath.toPath()), is(true));
Expand Down

0 comments on commit 2b02f06

Please sign in to comment.