Beispiel #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setup() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void Setup()
        {
            _testRealm = new TestRealm(thisnew InMemoryUserRepository(), new InMemoryRoleRepository(), new BasicPasswordPolicy(), NewRateLimitedAuthStrategy(), mock(typeof(JobScheduler)), new InMemoryUserRepository(), new InMemoryUserRepository()
                                       );

            IList <Realm> realms = listOf(_testRealm);

            _authManager = new MultiRealmAuthManager(_testRealm, realms, new MemoryConstrainedCacheManager(), mock(typeof(SecurityLog)), true, false, Collections.emptyMap());

            _authManager.init();
            _authManager.start();

            _authManager.UserManager.newUser("mike", password("123"), false);
        }
Beispiel #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 Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void Setup()
        {
            SecurityLog           securityLog           = mock(typeof(SecurityLog));
            InternalFlatFileRealm internalFlatFileRealm = new InternalFlatFileRealm(new InMemoryUserRepository(), new InMemoryRoleRepository(), new BasicPasswordPolicy(), new RateLimitedAuthenticationStrategy(Clock.systemUTC(), Config.defaults()), mock(typeof(JobScheduler)), new InMemoryUserRepository(), new InMemoryUserRepository()
                                                                                    );

            _testRealm = new TestRealm(this, LdapConfig, securityLog, new SecureHasher());

            IList <Realm> realms = listOf(internalFlatFileRealm, _testRealm);

            _fakeTicker  = new FakeTicker();
            _authManager = new MultiRealmAuthManager(internalFlatFileRealm, realms, new ShiroCaffeineCache.Manager(_fakeTicker.read, 100, 10, true), securityLog, false, false, Collections.emptyMap());
            _authManager.init();
            _authManager.start();

            _authManager.UserManager.newUser("mike", password("123"), false);
            _authManager.UserManager.newUser("mats", password("456"), false);
        }
Beispiel #3
0
 public AuthorizationInfoAnonymousInnerClass(TestRealm outerInstance)
 {
     this.outerInstance = outerInstance;
 }