SecurityContextHolder.setContext(new SecurityContextImpl());
}
public void testCaseGoodAuthenticationGoodAuthorisation() throws Exception
{
MuleClient client = new MuleClient(muleContext);
Map props = new HashMap();
EncryptionStrategy strategy = muleContext
.getSecurityManager()
.getEncryptionStrategy("PBE");
String header = MuleCredentials.createHeader("marie", "marie", "PBE", strategy);
props.put(MuleProperties.MULE_USER_PROPERTY, header);
client.dispatch("vm://test", "Marie", props);
MuleMessage m = client.request("vm://output", 3000);
assertNotNull(m);
assertEquals((String)m.getPayload(), "Marie");
}