@Test public void testWsSecurityConfig2() { WsSecurity wsSecurity = muleContext.getRegistry().lookupObject("config2"); assertNotNull(wsSecurity); assertNotNull(wsSecurity.getConfigProperties()); assertFalse(wsSecurity.getConfigProperties().isEmpty()); Map<String, Object> wsProperties = wsSecurity.getConfigProperties(); assertEquals( WSHandlerConstants.TIMESTAMP + " " + WSHandlerConstants.SIGNATURE + " " + WSHandlerConstants.ENCRYPT, wsProperties.get(WSHandlerConstants.ACTION)); assertEquals("joe", wsProperties.get(WSHandlerConstants.USER)); assertEquals( "org/mule/module/cxf/wssec/wssecurity.properties", wsProperties.get(WSHandlerConstants.SIG_PROP_FILE)); assertEquals( "org/mule/module/cxf/wssec/wssecurity.properties", wsProperties.get(WSHandlerConstants.ENC_PROP_FILE)); assertTrue( wsProperties.get(WSHandlerConstants.PW_CALLBACK_REF) instanceof ClientPasswordCallback); }
@Test public void testWsSecurityConfig() { WsSecurity wsSecurity = muleContext.getRegistry().lookupObject("config1"); assertNotNull(wsSecurity); assertNotNull(wsSecurity.getSecurityManager()); assertNotNull(wsSecurity.getConfigProperties()); assertFalse(wsSecurity.getConfigProperties().isEmpty()); Map<String, Object> wsProperties = wsSecurity.getConfigProperties(); assertEquals(WSHandlerConstants.USERNAME_TOKEN, wsProperties.get(WSHandlerConstants.ACTION)); assertEquals("joe", wsProperties.get(WSHandlerConstants.USER)); assertEquals("PasswordText", wsProperties.get(WSHandlerConstants.PASSWORD_TYPE)); assertEquals( "org.mule.module.cxf.wssec.ClientPasswordCallback", wsProperties.get(WSHandlerConstants.PW_CALLBACK_CLASS)); assertNotNull(wsSecurity.getCustomValidator()); assertFalse(wsSecurity.getCustomValidator().isEmpty()); assertTrue( wsSecurity.getCustomValidator().get(SecurityConstants.USERNAME_TOKEN_VALIDATOR) instanceof NoOpValidator); }