algorithmsClassMapField.setAccessible(true);
map = (Map<String, Class<?>>)algorithmsClassMapField.get(null);
map.put("http://www.apache.org/2012/04/xmlsec/xz", XZCompressorInputStream.class);
oldval = changeValueOfMaximumAllowedDecompressedBytes(101L);
WSSSecurityProperties outboundSecurityProperties = new WSSSecurityProperties();
outboundSecurityProperties.setCallbackHandler(new CallbackHandlerImpl());
outboundSecurityProperties.setEncryptionUser("receiver");
outboundSecurityProperties.loadEncryptionKeystore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());
outboundSecurityProperties.setSignatureUser("transmitter");
outboundSecurityProperties.loadSignatureKeyStore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());
List<WSSConstants.Action> actions = new ArrayList<WSSConstants.Action>();
actions.add(WSSConstants.TIMESTAMP);
actions.add(WSSConstants.SIGNATURE);
actions.add(WSSConstants.ENCRYPT);
outboundSecurityProperties.setActions(actions);
outboundSecurityProperties.setEncryptionCompressionAlgorithm("http://www.apache.org/2012/04/xmlsec/xz");
InputStream sourceDocument = this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml");
ByteArrayOutputStream baos = doOutboundSecurity(outboundSecurityProperties, sourceDocument);
WSSSecurityProperties inboundSecurityProperties = new WSSSecurityProperties();
inboundSecurityProperties.setCallbackHandler(new CallbackHandlerImpl());
inboundSecurityProperties.loadSignatureVerificationKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
inboundSecurityProperties.loadDecryptionKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
doInboundSecurity(inboundSecurityProperties,
xmlInputFactory.createXMLStreamReader(
new ByteArrayInputStream(baos.toByteArray())));
Assert.fail("Expected XMLStreamException");