Coverage Report - org.mule.tck.security.TestSecurityComponent
 
Classes in this File Line Coverage Branch Coverage Complexity
TestSecurityComponent
0%
0/9
N/A
1
 
 1  
 /*
 2  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 3  
  * The software in this package is published under the terms of the CPAL v1.0
 4  
  * license, a copy of which has been included with this distribution in the
 5  
  * LICENSE.txt file.
 6  
  */
 7  
 package org.mule.tck.security;
 8  
 
 9  
 
 10  
 import org.mule.api.MuleEventContext;
 11  
 import org.mule.api.lifecycle.Callable;
 12  
 import org.mule.api.security.Authentication;
 13  
 import org.mule.api.security.SecurityContext;
 14  
 
 15  
 import org.apache.commons.logging.Log;
 16  
 import org.apache.commons.logging.LogFactory;
 17  
 
 18  0
 public class TestSecurityComponent implements Callable
 19  
 {
 20  0
     protected static final Log logger = LogFactory.getLog(TestSecurityComponent.class);
 21  
     
 22  
     public Object onCall(MuleEventContext eventContext) throws Exception
 23  
     {
 24  0
         SecurityContext securityContext = eventContext.getSession().getSecurityContext();
 25  0
         Authentication authentication = securityContext.getAuthentication();
 26  
 
 27  0
         int numberLogins = (Integer) authentication.getProperties().get(TestSingleUserSecurityProvider.PROPERTY_NUMBER_LOGINS);
 28  0
         String favoriteColor = (String) authentication.getProperties().get(TestSingleUserSecurityProvider.PROPERTY_FAVORITE_COLOR);
 29  
 
 30  0
         String msg = "user = " + authentication.getPrincipal() + ", logins = " + numberLogins + ", color = " + favoriteColor;
 31  0
         logger.debug(msg);
 32  0
         return msg;
 33  
     }
 34  
 }
 35  
 
 36