Repository getInboxEntryRepository( InboxEntry inboxEntry ) { try { final Path path = Paths.get( inboxEntry.getItemPath() ); final FileSystem fileSystem = path.getFileSystem(); return configuredRepositories.getRepositoryByRepositoryFileSystem( fileSystem ); } catch ( FileSystemNotFoundException exception ) { return null; } }
Repository getEventRepository(SocialActivitiesEvent event) { final Path path = Paths.get(event.getLinkTarget()); final FileSystem fileSystem = path.getFileSystem(); return configuredRepositories.getRepositoryByRepositoryFileSystem(fileSystem); }
@Before public void setup() { testFileSystem = new TestFileSystem(); when( configuredRepositories.getRepositoryByRepositoryFileSystem( any( FileSystem.class ) ) ).thenReturn( repository ); inbox = new InboxEntrySecurity( mock( User.class ), mock( AuthorizationManager.class ), mock( OrganizationalUnitService.class ), mock( ProjectService.class ), configuredRepositories ); }