### Question:
PluginRealm extends AuthorizingRealm implements RealmLifecycle, ShiroAuthorizationInfoProvider { @Override public void initialize() throws Throwable { if ( authenticationPlugin != null ) { authenticationPlugin.initialize( authProviderOperations ); } if ( authorizationPlugin != null && authorizationPlugin != authenticationPlugin ) { authorizationPlugin.initialize( authProviderOperations ); } if ( authPlugin != null ) { authPlugin.initialize( authProviderOperations ); } } PluginRealm( Config config, SecurityLog securityLog, Clock clock, SecureHasher secureHasher );  PluginRealm( AuthenticationPlugin authenticationPlugin, AuthorizationPlugin authorizationPlugin,
            Config config, SecurityLog securityLog, Clock clock, SecureHasher secureHasher );  PluginRealm( AuthPlugin authPlugin, Config config, SecurityLog securityLog, Clock clock,
            SecureHasher secureHasher ); boolean canAuthenticate(); boolean canAuthorize(); @Override AuthorizationInfo getAuthorizationInfoSnapshot( PrincipalCollection principalCollection ); @Override boolean supports( AuthenticationToken token ); @Override void initialize(); @Override void start(); @Override void stop(); @Override void shutdown();  }### Answer:
@Test public void shouldLogToSecurityLogFromAuthPlugin() throws Throwable { PluginRealm pluginRealm = new PluginRealm( new LoggingAuthPlugin(), config, securityLog, Clock.systemUTC(), mock( SecureHasher.class ) ); pluginRealm.initialize(); assertLogged( "LoggingAuthPlugin" ); }
@Test public void shouldLogToSecurityLogFromAuthenticationPlugin() throws Throwable { PluginRealm pluginRealm = new PluginRealm( new LoggingAuthenticationPlugin(), null, config, securityLog, Clock.systemUTC(), mock( SecureHasher.class ) ); pluginRealm.initialize( ); assertLogged( "LoggingAuthenticationPlugin" ); }
@Test public void shouldLogToSecurityLogFromAuthorizationPlugin() throws Throwable { PluginRealm pluginRealm = new PluginRealm( null, new LoggingAuthorizationPlugin(), config, securityLog, Clock.systemUTC(), mock( SecureHasher.class ) ); pluginRealm.initialize(); assertLogged( "LoggingAuthorizationPlugin" ); }