Ejemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setup()
        public virtual void Setup()
        {
            _fileSystem = _fileSystemRule.get();
            OutsideWorld mock = mock(typeof(OutsideWorld));

            when(mock.FileSystem()).thenReturn(_fileSystem);
            _setPasswordCommand = new SetInitialPasswordCommand(_testDir.directory("home").toPath(), _testDir.directory("conf").toPath(), mock);
            _authInitFile       = CommunitySecurityModule.getInitialUserRepositoryFile(_setPasswordCommand.loadNeo4jConfig());
            CommunitySecurityModule.getUserRepositoryFile(_setPasswordCommand.loadNeo4jConfig());
        }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setup() throws java.io.IOException, org.neo4j.kernel.api.exceptions.InvalidArgumentsException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void Setup()
        {
            OutsideWorld mock = mock(typeof(OutsideWorld));

            when(mock.FileSystem()).thenReturn(_fileSystem);
            _setDefaultAdmin = new SetDefaultAdminCommand(TestDir.directory("home").toPath(), TestDir.directory("conf").toPath(), mock);
            _config          = _setDefaultAdmin.loadNeo4jConfig();
            UserRepository users = CommunitySecurityModule.getUserRepository(_config, NullLogProvider.Instance, _fileSystem);

            users.create(new User.Builder("jake", LegacyCredential.forPassword("123"))
                         .withRequiredPasswordChange(false).build());
            _adminIniFile = new File(CommunitySecurityModule.getUserRepositoryFile(_config).ParentFile, "admin.ini");
        }