Example #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldCreateCorrectAuthenticationInfoFromCustomCacheable()
        public virtual void ShouldCreateCorrectAuthenticationInfoFromCustomCacheable()
        {
            SecureHasher hasher = mock(typeof(SecureHasher));

            when(hasher.Hash(any())).thenReturn(new SimpleHash("some-hash"));

            PluginAuthenticationInfo internalAuthInfo = PluginAuthenticationInfo.CreateCacheable(CustomCacheableAuthenticationInfo.of("thePrincipal", ignoredAuthToken => true), "theRealm", hasher);

            assertThat((IList <string>)internalAuthInfo.Principals.asList(), containsInAnyOrder("thePrincipal"));
        }
Example #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldCreateCorrectAuthenticationInfo()
        public virtual void ShouldCreateCorrectAuthenticationInfo()
        {
            PluginAuthenticationInfo internalAuthInfo = PluginAuthenticationInfo.CreateCacheable(AuthenticationInfo.of("thePrincipal"), "theRealm", null);

            assertThat((IList <string>)internalAuthInfo.Principals.asList(), containsInAnyOrder("thePrincipal"));
        }