diff --git a/ph-as4-lib/src/main/java/com/helger/as4/mock/MockPModeGenerator.java b/ph-as4-lib/src/main/java/com/helger/as4/mock/MockPModeGenerator.java index 242459177..25691376c 100644 --- a/ph-as4-lib/src/main/java/com/helger/as4/mock/MockPModeGenerator.java +++ b/ph-as4-lib/src/main/java/com/helger/as4/mock/MockPModeGenerator.java @@ -1,159 +1,171 @@ -/** - * Copyright (C) 2015-2017 Philip Helger (www.helger.com) - * philip[at]helger[dot]com - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.helger.as4.mock; - -import javax.annotation.Nonnull; - -import com.helger.as4.crypto.ECryptoAlgorithmCrypt; -import com.helger.as4.crypto.ECryptoAlgorithmSign; -import com.helger.as4.crypto.ECryptoAlgorithmSignDigest; -import com.helger.as4.mgr.MetaAS4Manager; -import com.helger.as4.model.EMEP; -import com.helger.as4.model.ETransportChannelBinding; -import com.helger.as4.model.pmode.EPModeSendReceiptReplyPattern; -import com.helger.as4.model.pmode.PMode; -import com.helger.as4.model.pmode.PModeParty; -import com.helger.as4.model.pmode.config.PModeConfig; -import com.helger.as4.model.pmode.leg.PModeLeg; -import com.helger.as4.model.pmode.leg.PModeLegBusinessInformation; -import com.helger.as4.model.pmode.leg.PModeLegErrorHandling; -import com.helger.as4.model.pmode.leg.PModeLegProtocol; -import com.helger.as4.model.pmode.leg.PModeLegReliability; -import com.helger.as4.model.pmode.leg.PModeLegSecurity; -import com.helger.as4.soap.ESOAPVersion; -import com.helger.as4.wss.EWSSVersion; -import com.helger.commons.state.ETriState; - -public final class MockPModeGenerator -{ - public static String PMODE_CONFIG_ID_SOAP11_TEST = "pmode-test11"; - public static String PMODE_CONFIG_ID_SOAP12_TEST = "pmode-test"; - - private MockPModeGenerator () - {} - - @Nonnull - public static PModeConfig getTestPModeConfig (@Nonnull final ESOAPVersion eSOAPVersion) - { - return getTestPModeConfigSetID (eSOAPVersion, - eSOAPVersion.equals (ESOAPVersion.SOAP_12) ? PMODE_CONFIG_ID_SOAP12_TEST - : PMODE_CONFIG_ID_SOAP11_TEST); - } - - @Nonnull - public static PModeConfig getTestPModeConfigSetID (@Nonnull final ESOAPVersion eSOAPVersion, final String sPModeID) - { - final PModeConfig aConfig = new PModeConfig (sPModeID); - aConfig.setMEP (EMEP.ONE_WAY); - aConfig.setMEPBinding (ETransportChannelBinding.PUSH); - aConfig.setLeg1 (_generatePModeLeg (eSOAPVersion)); - // Leg 2 stays null, because we only use one-way - return aConfig; - } - - @Nonnull - private static PMode _createTestPMode (@Nonnull final PModeConfig aConfig) - { - MetaAS4Manager.getPModeConfigMgr ().createPModeConfigIfNotExisting (aConfig); - return new PMode (_generateInitiatorOrResponder (true), _generateInitiatorOrResponder (false), aConfig); - } - - @Nonnull - public static PMode getTestPMode (@Nonnull final ESOAPVersion eSOAPVersion) - { - return _createTestPMode (getTestPModeConfig (eSOAPVersion)); - } - - @Nonnull - public static PMode getTestPModeSetID (@Nonnull final ESOAPVersion eSOAPVersion, @Nonnull final String sPModeID) - { - return _createTestPMode (getTestPModeConfigSetID (eSOAPVersion, sPModeID)); - } - - @Nonnull - public static PMode getTestPModeWithSecurity (@Nonnull final ESOAPVersion eSOAPVersion) - { - final PModeConfig aConfig = getTestPModeConfig (eSOAPVersion); - - final PModeLegSecurity aPModeLegSecurity = new PModeLegSecurity (); - aPModeLegSecurity.setWSSVersion (EWSSVersion.WSS_111); - aPModeLegSecurity.setX509SignatureAlgorithm (ECryptoAlgorithmSign.RSA_SHA_256); - aPModeLegSecurity.setX509SignatureHashFunction (ECryptoAlgorithmSignDigest.DIGEST_SHA_256); - aPModeLegSecurity.setX509EncryptionAlgorithm (ECryptoAlgorithmCrypt.AES_128_GCM); - aPModeLegSecurity.setSendReceiptReplyPattern (EPModeSendReceiptReplyPattern.RESPONSE); - aPModeLegSecurity.setSendReceiptNonRepudiation (true); - - aConfig.setLeg1 (new PModeLeg (_generatePModeLegProtocol (eSOAPVersion), - _generatePModeLegBusinessInformation (), - _generatePModeLegErrorHandling (), - null, - aPModeLegSecurity)); - // Leg 2 stays null, because we only use one-way - return _createTestPMode (aConfig); - - } - - @Nonnull - private static PModeLeg _generatePModeLeg (@Nonnull final ESOAPVersion eSOAPVersion) - { - final PModeLegReliability aPModeLegReliability = null; - final PModeLegSecurity aPModeLegSecurity = null; - return new PModeLeg (_generatePModeLegProtocol (eSOAPVersion), - _generatePModeLegBusinessInformation (), - _generatePModeLegErrorHandling (), - aPModeLegReliability, - aPModeLegSecurity); - } - - private static PModeLegErrorHandling _generatePModeLegErrorHandling () - { - return new PModeLegErrorHandling (null, null, ETriState.TRUE, ETriState.TRUE, ETriState.TRUE, ETriState.TRUE); - } - - @Nonnull - private static PModeLegBusinessInformation _generatePModeLegBusinessInformation () - { - return new PModeLegBusinessInformation ("http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/test", - null, - null, - null, - null, - "http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/defaultMPC"); - } - - @Nonnull - private static PModeLegProtocol _generatePModeLegProtocol (@Nonnull final ESOAPVersion eSOAPVersion) - { - return new PModeLegProtocol ("http://localhost:8080", eSOAPVersion); - } - - @Nonnull - private static PModeParty _generateInitiatorOrResponder (final boolean bInitiator) - { - if (bInitiator) - return new PModeParty (null, - "APP_1000000101", - "http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/sender", - null, - null); - return new PModeParty (null, - "APP_1000000101", - "http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/responder", - null, - null); - } -} +/** + * Copyright (C) 2015-2017 Philip Helger (www.helger.com) + * philip[at]helger[dot]com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.helger.as4.mock; + +import javax.annotation.Nonnull; + +import com.helger.as4.crypto.ECryptoAlgorithmCrypt; +import com.helger.as4.crypto.ECryptoAlgorithmSign; +import com.helger.as4.crypto.ECryptoAlgorithmSignDigest; +import com.helger.as4.mgr.MetaAS4Manager; +import com.helger.as4.model.EMEP; +import com.helger.as4.model.ETransportChannelBinding; +import com.helger.as4.model.pmode.EPModeSendReceiptReplyPattern; +import com.helger.as4.model.pmode.PMode; +import com.helger.as4.model.pmode.PModeManager; +import com.helger.as4.model.pmode.PModeParty; +import com.helger.as4.model.pmode.config.PModeConfig; +import com.helger.as4.model.pmode.leg.PModeLeg; +import com.helger.as4.model.pmode.leg.PModeLegBusinessInformation; +import com.helger.as4.model.pmode.leg.PModeLegErrorHandling; +import com.helger.as4.model.pmode.leg.PModeLegProtocol; +import com.helger.as4.model.pmode.leg.PModeLegReliability; +import com.helger.as4.model.pmode.leg.PModeLegSecurity; +import com.helger.as4.soap.ESOAPVersion; +import com.helger.as4.wss.EWSSVersion; +import com.helger.commons.state.ETriState; + +public final class MockPModeGenerator +{ + public static String PMODE_CONFIG_ID_SOAP11_TEST = "mock-pmode-soap11"; + public static String PMODE_CONFIG_ID_SOAP12_TEST = "mock-pmode-soap12"; + + private MockPModeGenerator () + {} + + @Nonnull + public static PModeConfig getTestPModeConfig (@Nonnull final ESOAPVersion eSOAPVersion) + { + return getTestPModeConfigSetID (eSOAPVersion, + eSOAPVersion.equals (ESOAPVersion.SOAP_12) ? PMODE_CONFIG_ID_SOAP12_TEST + : PMODE_CONFIG_ID_SOAP11_TEST); + } + + @Nonnull + public static PModeConfig getTestPModeConfigSetID (@Nonnull final ESOAPVersion eSOAPVersion, final String sPModeID) + { + final PModeConfig aConfig = new PModeConfig (sPModeID); + aConfig.setMEP (EMEP.ONE_WAY); + aConfig.setMEPBinding (ETransportChannelBinding.PUSH); + aConfig.setLeg1 (_generatePModeLeg (eSOAPVersion)); + // Leg 2 stays null, because we only use one-way + return aConfig; + } + + @Nonnull + private static PMode _createTestPMode (@Nonnull final PModeConfig aConfig) + { + MetaAS4Manager.getPModeConfigMgr ().createOrUpdatePModeConfig (aConfig); + return new PMode (_generateInitiatorOrResponder (true), _generateInitiatorOrResponder (false), aConfig); + } + + @Nonnull + public static PMode getTestPMode (@Nonnull final ESOAPVersion eSOAPVersion) + { + return _createTestPMode (getTestPModeConfig (eSOAPVersion)); + } + + @Nonnull + public static PMode getTestPModeSetID (@Nonnull final ESOAPVersion eSOAPVersion, @Nonnull final String sPModeID) + { + return _createTestPMode (getTestPModeConfigSetID (eSOAPVersion, sPModeID)); + } + + @Nonnull + public static PMode getTestPModeWithSecurity (@Nonnull final ESOAPVersion eSOAPVersion) + { + final PModeConfig aConfig = getTestPModeConfig (eSOAPVersion); + + final PModeLegSecurity aPModeLegSecurity = new PModeLegSecurity (); + aPModeLegSecurity.setWSSVersion (EWSSVersion.WSS_111); + aPModeLegSecurity.setX509SignatureAlgorithm (ECryptoAlgorithmSign.RSA_SHA_256); + aPModeLegSecurity.setX509SignatureHashFunction (ECryptoAlgorithmSignDigest.DIGEST_SHA_256); + aPModeLegSecurity.setX509EncryptionAlgorithm (ECryptoAlgorithmCrypt.AES_128_GCM); + aPModeLegSecurity.setSendReceiptReplyPattern (EPModeSendReceiptReplyPattern.RESPONSE); + aPModeLegSecurity.setSendReceiptNonRepudiation (true); + + aConfig.setLeg1 (new PModeLeg (_generatePModeLegProtocol (eSOAPVersion), + _generatePModeLegBusinessInformation (), + _generatePModeLegErrorHandling (), + null, + aPModeLegSecurity)); + // Leg 2 stays null, because we only use one-way + return _createTestPMode (aConfig); + + } + + @Nonnull + private static PModeLeg _generatePModeLeg (@Nonnull final ESOAPVersion eSOAPVersion) + { + final PModeLegReliability aPModeLegReliability = null; + final PModeLegSecurity aPModeLegSecurity = null; + return new PModeLeg (_generatePModeLegProtocol (eSOAPVersion), + _generatePModeLegBusinessInformation (), + _generatePModeLegErrorHandling (), + aPModeLegReliability, + aPModeLegSecurity); + } + + private static PModeLegErrorHandling _generatePModeLegErrorHandling () + { + return new PModeLegErrorHandling (null, null, ETriState.TRUE, ETriState.TRUE, ETriState.TRUE, ETriState.TRUE); + } + + @Nonnull + private static PModeLegBusinessInformation _generatePModeLegBusinessInformation () + { + return new PModeLegBusinessInformation ("http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/test", + null, + null, + null, + null, + "http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/defaultMPC"); + } + + @Nonnull + private static PModeLegProtocol _generatePModeLegProtocol (@Nonnull final ESOAPVersion eSOAPVersion) + { + return new PModeLegProtocol ("http://localhost:8080", eSOAPVersion); + } + + @Nonnull + private static PModeParty _generateInitiatorOrResponder (final boolean bInitiator) + { + if (bInitiator) + return new PModeParty (null, + "APP_1000000101", + "http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/sender", + null, + null); + return new PModeParty (null, + "APP_1000000101", + "http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/responder", + null, + null); + } + + public static void ensureMockPModesArePresent () + { + final PModeManager aPModeMgr = MetaAS4Manager.getPModeMgr (); + for (final ESOAPVersion e : ESOAPVersion.values ()) + { + final PMode aPMode = MockPModeGenerator.getTestPModeWithSecurity (e); + if (!aPModeMgr.containsWithID (aPMode.getID ())) + aPModeMgr.createPMode (aPMode); + } + } +} diff --git a/ph-as4-lib/src/main/java/com/helger/as4/model/pmode/DefaultPMode.java b/ph-as4-lib/src/main/java/com/helger/as4/model/pmode/DefaultPMode.java index 3f2ab1e58..e27333f9d 100644 --- a/ph-as4-lib/src/main/java/com/helger/as4/model/pmode/DefaultPMode.java +++ b/ph-as4-lib/src/main/java/com/helger/as4/model/pmode/DefaultPMode.java @@ -1,112 +1,112 @@ -/** - * Copyright (C) 2015-2017 Philip Helger (www.helger.com) - * philip[at]helger[dot]com - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.helger.as4.model.pmode; - -import javax.annotation.Nonnull; -import javax.annotation.concurrent.Immutable; - -import com.helger.as4.mgr.MetaAS4Manager; -import com.helger.as4.model.EMEP; -import com.helger.as4.model.ETransportChannelBinding; -import com.helger.as4.model.mpc.MPCManager; -import com.helger.as4.model.pmode.config.IPModeConfig; -import com.helger.as4.model.pmode.config.PModeConfig; -import com.helger.as4.model.pmode.leg.PModeLeg; -import com.helger.as4.model.pmode.leg.PModeLegBusinessInformation; -import com.helger.as4.model.pmode.leg.PModeLegProtocol; -import com.helger.as4.model.pmode.leg.PModeLegReliability; -import com.helger.as4.model.pmode.leg.PModeLegSecurity; -import com.helger.as4.soap.ESOAPVersion; - -/** - * Default MPC Specification from - * http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/core/os/ebms_core-3.0-spec-os. - * pdf Only use if necessary and nothing is used/defined. - * - * @author bayerlma - */ -@Immutable -public final class DefaultPMode -{ - private DefaultPMode () - {} - - @Nonnull - public static IPModeConfig getDefaultPModeConfig () - { - final PModeConfig aDefaultConfig = new PModeConfig ("default-pmode"); - aDefaultConfig.setMEP (EMEP.ONE_WAY); - aDefaultConfig.setMEPBinding (ETransportChannelBinding.PUSH); - aDefaultConfig.setLeg1 (_generatePModeLeg ()); - // Leg 2 stays null, because we only use one-way - MetaAS4Manager.getPModeConfigMgr ().createPModeConfigIfNotExisting (aDefaultConfig); - return aDefaultConfig; - } - - @Nonnull - public static IPMode getDefaultPMode () - { - return new PMode (_generateInitiatorOrResponder (true), - _generateInitiatorOrResponder (false), - getDefaultPModeConfig ()); - } - - @Nonnull - private static PModeLeg _generatePModeLeg () - { - final PModeLegReliability aPModeLegReliability = null; - final PModeLegSecurity aPModeLegSecurity = null; - return new PModeLeg (_generatePModeLegProtocol (), - _generatePModeLegBusinessInformation (), - null, - aPModeLegReliability, - aPModeLegSecurity); - } - - @Nonnull - private static PModeLegBusinessInformation _generatePModeLegBusinessInformation () - { - return new PModeLegBusinessInformation ("http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/test", - null, - null, - null, - null, - MPCManager.DEFAULT_MPC_ID); - } - - @Nonnull - private static PModeLegProtocol _generatePModeLegProtocol () - { - return new PModeLegProtocol ("HTTP 1.1", ESOAPVersion.AS4_DEFAULT); - } - - @Nonnull - private static PModeParty _generateInitiatorOrResponder (final boolean bInitiator) - { - if (bInitiator) - return new PModeParty (null, - "http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/defaultFrom", - "http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/sender", - null, - null); - return new PModeParty (null, - "http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/defaultTo", - "http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/responder", - null, - null); - } -} +/** + * Copyright (C) 2015-2017 Philip Helger (www.helger.com) + * philip[at]helger[dot]com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.helger.as4.model.pmode; + +import javax.annotation.Nonnull; +import javax.annotation.concurrent.Immutable; + +import com.helger.as4.mgr.MetaAS4Manager; +import com.helger.as4.model.EMEP; +import com.helger.as4.model.ETransportChannelBinding; +import com.helger.as4.model.mpc.MPCManager; +import com.helger.as4.model.pmode.config.IPModeConfig; +import com.helger.as4.model.pmode.config.PModeConfig; +import com.helger.as4.model.pmode.leg.PModeLeg; +import com.helger.as4.model.pmode.leg.PModeLegBusinessInformation; +import com.helger.as4.model.pmode.leg.PModeLegProtocol; +import com.helger.as4.model.pmode.leg.PModeLegReliability; +import com.helger.as4.model.pmode.leg.PModeLegSecurity; +import com.helger.as4.soap.ESOAPVersion; + +/** + * Default MPC Specification from + * http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/core/os/ebms_core-3.0-spec-os. + * pdf Only use if necessary and nothing is used/defined. + * + * @author bayerlma + */ +@Immutable +public final class DefaultPMode +{ + private DefaultPMode () + {} + + @Nonnull + public static IPModeConfig getDefaultPModeConfig () + { + final PModeConfig aDefaultConfig = new PModeConfig ("default-pmode"); + aDefaultConfig.setMEP (EMEP.ONE_WAY); + aDefaultConfig.setMEPBinding (ETransportChannelBinding.PUSH); + aDefaultConfig.setLeg1 (_generatePModeLeg ()); + // Leg 2 stays null, because we only use one-way + MetaAS4Manager.getPModeConfigMgr ().createOrUpdatePModeConfig (aDefaultConfig); + return aDefaultConfig; + } + + @Nonnull + public static IPMode getDefaultPMode () + { + return new PMode (_generateInitiatorOrResponder (true), + _generateInitiatorOrResponder (false), + getDefaultPModeConfig ()); + } + + @Nonnull + private static PModeLeg _generatePModeLeg () + { + final PModeLegReliability aPModeLegReliability = null; + final PModeLegSecurity aPModeLegSecurity = null; + return new PModeLeg (_generatePModeLegProtocol (), + _generatePModeLegBusinessInformation (), + null, + aPModeLegReliability, + aPModeLegSecurity); + } + + @Nonnull + private static PModeLegBusinessInformation _generatePModeLegBusinessInformation () + { + return new PModeLegBusinessInformation ("http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/test", + null, + null, + null, + null, + MPCManager.DEFAULT_MPC_ID); + } + + @Nonnull + private static PModeLegProtocol _generatePModeLegProtocol () + { + return new PModeLegProtocol ("HTTP 1.1", ESOAPVersion.AS4_DEFAULT); + } + + @Nonnull + private static PModeParty _generateInitiatorOrResponder (final boolean bInitiator) + { + if (bInitiator) + return new PModeParty (null, + "http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/defaultFrom", + "http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/sender", + null, + null); + return new PModeParty (null, + "http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/defaultTo", + "http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/responder", + null, + null); + } +} diff --git a/ph-as4-lib/src/main/java/com/helger/as4/model/pmode/config/PModeConfigManager.java b/ph-as4-lib/src/main/java/com/helger/as4/model/pmode/config/PModeConfigManager.java index 0f669ab85..d3f06910c 100644 --- a/ph-as4-lib/src/main/java/com/helger/as4/model/pmode/config/PModeConfigManager.java +++ b/ph-as4-lib/src/main/java/com/helger/as4/model/pmode/config/PModeConfigManager.java @@ -24,7 +24,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.common.annotations.VisibleForTesting; import com.helger.as4.util.AS4IOHelper; import com.helger.commons.ValueEnforcer; import com.helger.commons.annotation.ReturnsMutableCopy; @@ -68,14 +67,6 @@ protected IMicroDocument createWriteData () return ret; } - @VisibleForTesting - public void createPModeConfigIfNotExisting (@Nonnull final PModeConfig aPModeConfig) - { - ValueEnforcer.notNull (aPModeConfig, "PModeConfig"); - if (!containsWithID (aPModeConfig.getID ())) - createPModeConfig (aPModeConfig); - } - public void createOrUpdatePModeConfig (@Nonnull final PModeConfig aPModeConfig) { ValueEnforcer.notNull (aPModeConfig, "PModeConfig"); diff --git a/ph-as4-lib/src/test/java/com/helger/as4/model/pmode/PModeMicroTypeConverterTest.java b/ph-as4-lib/src/test/java/com/helger/as4/model/pmode/PModeMicroTypeConverterTest.java index 6fa924611..b346cf085 100644 --- a/ph-as4-lib/src/test/java/com/helger/as4/model/pmode/PModeMicroTypeConverterTest.java +++ b/ph-as4-lib/src/test/java/com/helger/as4/model/pmode/PModeMicroTypeConverterTest.java @@ -1,235 +1,235 @@ -/** - * Copyright (C) 2015-2017 Philip Helger (www.helger.com) - * philip[at]helger[dot]com - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.helger.as4.model.pmode; - -import javax.annotation.Nonnull; - -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TestRule; - -import com.helger.as4.AS4TestRule; -import com.helger.as4.attachment.EAS4CompressionMode; -import com.helger.as4.crypto.ECryptoAlgorithmCrypt; -import com.helger.as4.crypto.ECryptoAlgorithmSign; -import com.helger.as4.crypto.ECryptoAlgorithmSignDigest; -import com.helger.as4.mgr.MetaAS4Manager; -import com.helger.as4.model.EMEP; -import com.helger.as4.model.ETransportChannelBinding; -import com.helger.as4.model.pmode.config.PModeConfig; -import com.helger.as4.model.pmode.leg.PModeLeg; -import com.helger.as4.model.pmode.leg.PModeLegBusinessInformation; -import com.helger.as4.model.pmode.leg.PModeLegErrorHandling; -import com.helger.as4.model.pmode.leg.PModeLegProtocol; -import com.helger.as4.model.pmode.leg.PModeLegReliability; -import com.helger.as4.model.pmode.leg.PModeLegSecurity; -import com.helger.as4.soap.ESOAPVersion; -import com.helger.as4.wss.EWSSVersion; -import com.helger.commons.annotation.ReturnsMutableCopy; -import com.helger.commons.collection.ext.CommonsArrayList; -import com.helger.commons.collection.ext.CommonsLinkedHashMap; -import com.helger.commons.collection.ext.ICommonsList; -import com.helger.commons.collection.ext.ICommonsOrderedMap; -import com.helger.commons.mime.EMimeContentType; -import com.helger.commons.mime.MimeType; -import com.helger.commons.state.EMandatory; -import com.helger.commons.state.ETriState; -import com.helger.xml.mock.XMLTestHelper; - -/** - * Test class for class {@link PModeMicroTypeConverter}. - * - * @author Philip Helger - */ -public final class PModeMicroTypeConverterTest -{ - @Rule - public final TestRule m_aTestRule = new AS4TestRule (); - - @Test - public void testAsSimpleAsPossible () - { - final PModeConfig aPModeConfig = new PModeConfig ("id"); - XMLTestHelper.testMicroTypeConversion (aPModeConfig); - } - - @Test - public void testNativToMicroElementConversion () - { - final PModeConfig aPModeConfig = new PModeConfig ("id"); - { - aPModeConfig.setAgreement ("Agreement"); - aPModeConfig.setMEP (EMEP.TWO_WAY_PUSH_PULL); - aPModeConfig.setMEPBinding (ETransportChannelBinding.SYNC); - aPModeConfig.setLeg1 (_generatePModeLeg ()); - aPModeConfig.setLeg2 (_generatePModeLeg ()); - aPModeConfig.setPayloadService (_generatePayloadService ()); - aPModeConfig.setReceptionAwareness (_generatePModeReceptionAwareness ()); - XMLTestHelper.testMicroTypeConversion (aPModeConfig); - XMLTestHelper.testMicroTypeConversion (aPModeConfig.getLeg1 ()); - XMLTestHelper.testMicroTypeConversion (aPModeConfig.getLeg2 ()); - } - MetaAS4Manager.getPModeConfigMgr ().createPModeConfigIfNotExisting (aPModeConfig); - - { - final PMode aPMode = new PMode (_generateInitiatorOrResponder (true), - _generateInitiatorOrResponder (false), - aPModeConfig); - XMLTestHelper.testMicroTypeConversion (aPMode); - XMLTestHelper.testMicroTypeConversion (aPMode.getInitiator ()); - XMLTestHelper.testMicroTypeConversion (aPMode.getResponder ()); - XMLTestHelper.testMicroTypeConversion (aPMode.getConfig ()); - } - } - - @Nonnull - private PModePayloadService _generatePayloadService () - { - return new PModePayloadService (EAS4CompressionMode.GZIP); - } - - @Nonnull - private PModeReceptionAwareness _generatePModeReceptionAwareness () - { - return new PModeReceptionAwareness (ETriState.TRUE, ETriState.TRUE, ETriState.TRUE); - } - - @Nonnull - private PModeParty _generateInitiatorOrResponder (final boolean bInitiator) - { - if (bInitiator) - return new PModeParty ("initiator-type", "idvalue", "sender", "test", "testpw"); - return new PModeParty ("responder-type", "idvalue2", "responder", "test2", "test2pw"); - } - - @Nonnull - private PModeLeg _generatePModeLeg () - { - return new PModeLeg (_generatePModeLegProtocol (), - _generatePModeLegBusinessInformation (), - _generatePModeLegErrorHandling (), - _generatePModeLegReliability (), - _generatePModeLegSecurity ()); - } - - @Nonnull - private PModeLegBusinessInformation _generatePModeLegBusinessInformation () - { - return new PModeLegBusinessInformation ("service", - "action1", - _generatePModeProperties (), - _generatePModePayloadProfile (), - 20000, - "mpcexample"); - } - - @Nonnull - @ReturnsMutableCopy - private ICommonsOrderedMap _generatePModePayloadProfile () - { - final PModePayloadProfile aPModePayloadProfile = new PModePayloadProfile ("name", - new MimeType (EMimeContentType.EXAMPLE, - "example"), - "xsdfilename", - 20001, - EMandatory.MANDATORY); - final ICommonsOrderedMap aPModePayloadProfiles = new CommonsLinkedHashMap<> (); - aPModePayloadProfiles.put (aPModePayloadProfile.getName (), aPModePayloadProfile); - return aPModePayloadProfiles; - } - - @Nonnull - @ReturnsMutableCopy - private ICommonsOrderedMap _generatePModeProperties () - { - final PModeProperty aPModeProperty = new PModeProperty ("name", - "description", - PModeProperty.DATA_TYPE_STRING, - EMandatory.MANDATORY); - final ICommonsOrderedMap aPModeProperties = new CommonsLinkedHashMap<> (); - aPModeProperties.put (aPModeProperty.getName (), aPModeProperty); - return aPModeProperties; - } - - @Nonnull - private PModeLegErrorHandling _generatePModeLegErrorHandling () - { - return new PModeLegErrorHandling (_generatePModeAddressList (), - _generatePModeAddressList (), - ETriState.TRUE, - ETriState.TRUE, - ETriState.TRUE, - ETriState.TRUE); - } - - @Nonnull - private PModeAddressList _generatePModeAddressList () - { - return new PModeAddressList ("address1"); - } - - @Nonnull - private PModeLegProtocol _generatePModeLegProtocol () - { - return new PModeLegProtocol ("addressProtocol", ESOAPVersion.SOAP_11); - } - - @Nonnull - private PModeLegReliability _generatePModeLegReliability () - { - final ICommonsList aCorrelation = new CommonsArrayList<> ("correlation", "correlation2"); - return new PModeLegReliability (ETriState.TRUE, - ETriState.TRUE, - "ack", - ETriState.TRUE, - "replyPattern", - ETriState.TRUE, - ETriState.TRUE, - ETriState.TRUE, - aCorrelation, - ETriState.TRUE); - - } - - @Nonnull - private PModeLegSecurity _generatePModeLegSecurity () - { - final ICommonsList aX509EncryptionEncrypt = new CommonsArrayList<> ("X509EncryptionEncrypt", - "X509EncryptionEncrypt2"); - final ICommonsList aX509Sign = new CommonsArrayList<> ("X509Sign", "X509Sign2"); - return new PModeLegSecurity (EWSSVersion.WSS_111, - aX509Sign, - aX509Sign, - "X509SignatureCertificate", - ECryptoAlgorithmSignDigest.SIGN_DIGEST_ALGORITHM_DEFAULT, - ECryptoAlgorithmSign.SIGN_ALGORITHM_DEFAULT, - aX509EncryptionEncrypt, - aX509EncryptionEncrypt, - "X509EncryptionCertificate", - ECryptoAlgorithmCrypt.AES_128_GCM, - 1, - "usernametokenusername", - "usernametokenpassword", - ETriState.TRUE, - ETriState.TRUE, - ETriState.TRUE, - ETriState.TRUE, - ETriState.TRUE, - EPModeSendReceiptReplyPattern.RESPONSE, - ETriState.TRUE); - } -} +/** + * Copyright (C) 2015-2017 Philip Helger (www.helger.com) + * philip[at]helger[dot]com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.helger.as4.model.pmode; + +import javax.annotation.Nonnull; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TestRule; + +import com.helger.as4.AS4TestRule; +import com.helger.as4.attachment.EAS4CompressionMode; +import com.helger.as4.crypto.ECryptoAlgorithmCrypt; +import com.helger.as4.crypto.ECryptoAlgorithmSign; +import com.helger.as4.crypto.ECryptoAlgorithmSignDigest; +import com.helger.as4.mgr.MetaAS4Manager; +import com.helger.as4.model.EMEP; +import com.helger.as4.model.ETransportChannelBinding; +import com.helger.as4.model.pmode.config.PModeConfig; +import com.helger.as4.model.pmode.leg.PModeLeg; +import com.helger.as4.model.pmode.leg.PModeLegBusinessInformation; +import com.helger.as4.model.pmode.leg.PModeLegErrorHandling; +import com.helger.as4.model.pmode.leg.PModeLegProtocol; +import com.helger.as4.model.pmode.leg.PModeLegReliability; +import com.helger.as4.model.pmode.leg.PModeLegSecurity; +import com.helger.as4.soap.ESOAPVersion; +import com.helger.as4.wss.EWSSVersion; +import com.helger.commons.annotation.ReturnsMutableCopy; +import com.helger.commons.collection.ext.CommonsArrayList; +import com.helger.commons.collection.ext.CommonsLinkedHashMap; +import com.helger.commons.collection.ext.ICommonsList; +import com.helger.commons.collection.ext.ICommonsOrderedMap; +import com.helger.commons.mime.EMimeContentType; +import com.helger.commons.mime.MimeType; +import com.helger.commons.state.EMandatory; +import com.helger.commons.state.ETriState; +import com.helger.xml.mock.XMLTestHelper; + +/** + * Test class for class {@link PModeMicroTypeConverter}. + * + * @author Philip Helger + */ +public final class PModeMicroTypeConverterTest +{ + @Rule + public final TestRule m_aTestRule = new AS4TestRule (); + + @Test + public void testAsSimpleAsPossible () + { + final PModeConfig aPModeConfig = new PModeConfig ("id"); + XMLTestHelper.testMicroTypeConversion (aPModeConfig); + } + + @Test + public void testNativToMicroElementConversion () + { + final PModeConfig aPModeConfig = new PModeConfig ("id"); + { + aPModeConfig.setAgreement ("Agreement"); + aPModeConfig.setMEP (EMEP.TWO_WAY_PUSH_PULL); + aPModeConfig.setMEPBinding (ETransportChannelBinding.SYNC); + aPModeConfig.setLeg1 (_generatePModeLeg ()); + aPModeConfig.setLeg2 (_generatePModeLeg ()); + aPModeConfig.setPayloadService (_generatePayloadService ()); + aPModeConfig.setReceptionAwareness (_generatePModeReceptionAwareness ()); + XMLTestHelper.testMicroTypeConversion (aPModeConfig); + XMLTestHelper.testMicroTypeConversion (aPModeConfig.getLeg1 ()); + XMLTestHelper.testMicroTypeConversion (aPModeConfig.getLeg2 ()); + } + MetaAS4Manager.getPModeConfigMgr ().createOrUpdatePModeConfig (aPModeConfig); + + { + final PMode aPMode = new PMode (_generateInitiatorOrResponder (true), + _generateInitiatorOrResponder (false), + aPModeConfig); + XMLTestHelper.testMicroTypeConversion (aPMode); + XMLTestHelper.testMicroTypeConversion (aPMode.getInitiator ()); + XMLTestHelper.testMicroTypeConversion (aPMode.getResponder ()); + XMLTestHelper.testMicroTypeConversion (aPMode.getConfig ()); + } + } + + @Nonnull + private PModePayloadService _generatePayloadService () + { + return new PModePayloadService (EAS4CompressionMode.GZIP); + } + + @Nonnull + private PModeReceptionAwareness _generatePModeReceptionAwareness () + { + return new PModeReceptionAwareness (ETriState.TRUE, ETriState.TRUE, ETriState.TRUE); + } + + @Nonnull + private PModeParty _generateInitiatorOrResponder (final boolean bInitiator) + { + if (bInitiator) + return new PModeParty ("initiator-type", "idvalue", "sender", "test", "testpw"); + return new PModeParty ("responder-type", "idvalue2", "responder", "test2", "test2pw"); + } + + @Nonnull + private PModeLeg _generatePModeLeg () + { + return new PModeLeg (_generatePModeLegProtocol (), + _generatePModeLegBusinessInformation (), + _generatePModeLegErrorHandling (), + _generatePModeLegReliability (), + _generatePModeLegSecurity ()); + } + + @Nonnull + private PModeLegBusinessInformation _generatePModeLegBusinessInformation () + { + return new PModeLegBusinessInformation ("service", + "action1", + _generatePModeProperties (), + _generatePModePayloadProfile (), + 20000, + "mpcexample"); + } + + @Nonnull + @ReturnsMutableCopy + private ICommonsOrderedMap _generatePModePayloadProfile () + { + final PModePayloadProfile aPModePayloadProfile = new PModePayloadProfile ("name", + new MimeType (EMimeContentType.EXAMPLE, + "example"), + "xsdfilename", + 20001, + EMandatory.MANDATORY); + final ICommonsOrderedMap aPModePayloadProfiles = new CommonsLinkedHashMap<> (); + aPModePayloadProfiles.put (aPModePayloadProfile.getName (), aPModePayloadProfile); + return aPModePayloadProfiles; + } + + @Nonnull + @ReturnsMutableCopy + private ICommonsOrderedMap _generatePModeProperties () + { + final PModeProperty aPModeProperty = new PModeProperty ("name", + "description", + PModeProperty.DATA_TYPE_STRING, + EMandatory.MANDATORY); + final ICommonsOrderedMap aPModeProperties = new CommonsLinkedHashMap<> (); + aPModeProperties.put (aPModeProperty.getName (), aPModeProperty); + return aPModeProperties; + } + + @Nonnull + private PModeLegErrorHandling _generatePModeLegErrorHandling () + { + return new PModeLegErrorHandling (_generatePModeAddressList (), + _generatePModeAddressList (), + ETriState.TRUE, + ETriState.TRUE, + ETriState.TRUE, + ETriState.TRUE); + } + + @Nonnull + private PModeAddressList _generatePModeAddressList () + { + return new PModeAddressList ("address1"); + } + + @Nonnull + private PModeLegProtocol _generatePModeLegProtocol () + { + return new PModeLegProtocol ("addressProtocol", ESOAPVersion.SOAP_11); + } + + @Nonnull + private PModeLegReliability _generatePModeLegReliability () + { + final ICommonsList aCorrelation = new CommonsArrayList<> ("correlation", "correlation2"); + return new PModeLegReliability (ETriState.TRUE, + ETriState.TRUE, + "ack", + ETriState.TRUE, + "replyPattern", + ETriState.TRUE, + ETriState.TRUE, + ETriState.TRUE, + aCorrelation, + ETriState.TRUE); + + } + + @Nonnull + private PModeLegSecurity _generatePModeLegSecurity () + { + final ICommonsList aX509EncryptionEncrypt = new CommonsArrayList<> ("X509EncryptionEncrypt", + "X509EncryptionEncrypt2"); + final ICommonsList aX509Sign = new CommonsArrayList<> ("X509Sign", "X509Sign2"); + return new PModeLegSecurity (EWSSVersion.WSS_111, + aX509Sign, + aX509Sign, + "X509SignatureCertificate", + ECryptoAlgorithmSignDigest.SIGN_DIGEST_ALGORITHM_DEFAULT, + ECryptoAlgorithmSign.SIGN_ALGORITHM_DEFAULT, + aX509EncryptionEncrypt, + aX509EncryptionEncrypt, + "X509EncryptionCertificate", + ECryptoAlgorithmCrypt.AES_128_GCM, + 1, + "usernametokenusername", + "usernametokenpassword", + ETriState.TRUE, + ETriState.TRUE, + ETriState.TRUE, + ETriState.TRUE, + ETriState.TRUE, + EPModeSendReceiptReplyPattern.RESPONSE, + ETriState.TRUE); + } +} diff --git a/ph-as4-server-webapp-demo/.gitignore b/ph-as4-server-webapp-demo/.gitignore index c134ae1e9..a08111308 100644 --- a/ph-as4-server-webapp-demo/.gitignore +++ b/ph-as4-server-webapp-demo/.gitignore @@ -1,14 +1,16 @@ -*.class - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.jar -*.war -*.ear - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* - -target/ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +/target/ +/as4-data/ +/as4-test-data/ diff --git a/ph-as4-server-webapp-demo/as4-data/.gitignore b/ph-as4-server-webapp-demo/as4-data/.gitignore deleted file mode 100644 index 261adbf4d..000000000 --- a/ph-as4-server-webapp-demo/as4-data/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/*.xml -/*.dat -/**/* \ No newline at end of file diff --git a/ph-as4-server-webapp-demo/as4-test-data/.gitignore b/ph-as4-server-webapp-demo/as4-test-data/.gitignore deleted file mode 100644 index 261adbf4d..000000000 --- a/ph-as4-server-webapp-demo/as4-test-data/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/*.xml -/*.dat -/**/* \ No newline at end of file diff --git a/ph-as4-server-webapp-demo/src/test/java/com/helger/as4/lib/client/AS4ClientTest.java b/ph-as4-server-webapp-demo/src/test/java/com/helger/as4/lib/client/AS4ClientTest.java index ba8473c52..40c1cd336 100644 --- a/ph-as4-server-webapp-demo/src/test/java/com/helger/as4/lib/client/AS4ClientTest.java +++ b/ph-as4-server-webapp-demo/src/test/java/com/helger/as4/lib/client/AS4ClientTest.java @@ -16,12 +16,9 @@ */ package com.helger.as4.lib.client; -import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import java.util.function.Predicate; - import javax.annotation.Nonnull; import org.apache.http.util.EntityUtils; @@ -35,10 +32,8 @@ import com.helger.as4.crypto.ECryptoAlgorithmCrypt; import com.helger.as4.crypto.ECryptoAlgorithmSign; import com.helger.as4.crypto.ECryptoAlgorithmSignDigest; -import com.helger.as4.mgr.MetaAS4Manager; import com.helger.as4.mock.MockEbmsHelper; import com.helger.as4.mock.MockPModeGenerator; -import com.helger.as4.model.pmode.IPMode; import com.helger.as4.server.MockJettySetup; import com.helger.as4.servlet.mgr.AS4ServerConfiguration; import com.helger.as4.soap.ESOAPVersion; @@ -67,6 +62,7 @@ public static void startServer () throws Exception AS4ServerConfiguration.reinitForTestOnly (); MockJettySetup.startServer (); s_aResMgr = MockJettySetup.getResourceManagerInstance (); + MockPModeGenerator.ensureMockPModesArePresent (); } @AfterClass @@ -76,22 +72,6 @@ public static void shutDownServer () throws Exception MockJettySetup.shutDownServer (); } - /** - * A Filter that searches for the PModeID from the given MockPmode with the - * right SOAPVersion - * - * @param eESOAPVersion - * declares which pmode should be chosen depending on the SOAP Version - * @return a PMode - */ - @Nonnull - private static Predicate _getTestPModeFilter (@Nonnull final ESOAPVersion eESOAPVersion) - { - if (eESOAPVersion.equals (ESOAPVersion.SOAP_12)) - return p -> p.getConfigID ().equals (MockPModeGenerator.PMODE_CONFIG_ID_SOAP12_TEST); - return p -> p.getConfigID ().equals (MockPModeGenerator.PMODE_CONFIG_ID_SOAP11_TEST); - } - /** * To reduce the amount of code in each test, this method sets the basic * attributes that are needed for a successful message to build.
@@ -103,17 +83,17 @@ private static Predicate _getTestPModeFilter (@Nonnull final ESOAPVersi private static AS4Client _getMandatoryAttributesSuccessMessage () { final AS4Client aClient = new AS4Client (s_aResMgr); - aClient.setSOAPVersion (ESOAPVersion.AS4_DEFAULT); + aClient.setSOAPVersion (ESOAPVersion.SOAP_12); + // Use a pmode that you know is currently running on the server your trying // to send the message too - final IPMode aPModeID = MetaAS4Manager.getPModeMgr ().findFirst (_getTestPModeFilter (aClient.getSOAPVersion ())); - assertNotNull (aPModeID); + final String sPModeID = MockPModeGenerator.PMODE_CONFIG_ID_SOAP12_TEST; aClient.setAction ("AnAction"); aClient.setServiceType ("MyServiceType"); aClient.setServiceValue ("OrderPaper"); aClient.setConversationID ("9898"); - aClient.setAgreementRefPMode (aPModeID.getConfigID ()); + aClient.setAgreementRefPMode (sPModeID); aClient.setAgreementRefValue ("http://agreements.holodeckb2b.org/examples/agreement0"); aClient.setFromRole (CAS4.DEFAULT_ROLE); aClient.setFromPartyID ("MyPartyIDforSending"); diff --git a/ph-as4-server-webapp-demo/src/test/java/com/helger/as4/server/AbstractClientSetUp.java b/ph-as4-server-webapp-demo/src/test/java/com/helger/as4/server/AbstractClientSetUp.java index f229f524d..a7aa1d079 100644 --- a/ph-as4-server-webapp-demo/src/test/java/com/helger/as4/server/AbstractClientSetUp.java +++ b/ph-as4-server-webapp-demo/src/test/java/com/helger/as4/server/AbstractClientSetUp.java @@ -1,119 +1,112 @@ -/** - * Copyright (C) 2015-2017 Philip Helger (www.helger.com) - * philip[at]helger[dot]com - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.helger.as4.server; - -import java.security.KeyManagementException; -import java.security.NoSuchAlgorithmException; - -import javax.annotation.Nonnull; -import javax.net.ssl.SSLContext; -import javax.net.ssl.TrustManager; - -import org.apache.http.HttpHost; -import org.apache.http.client.config.CookieSpecs; -import org.apache.http.client.config.RequestConfig; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.impl.client.CloseableHttpClient; -import org.junit.After; -import org.junit.Before; - -import com.helger.as4.mgr.MetaAS4Manager; -import com.helger.as4.mock.MockPModeGenerator; -import com.helger.as4.model.pmode.PMode; -import com.helger.as4.servlet.mgr.AS4ServerConfiguration; -import com.helger.as4.soap.ESOAPVersion; -import com.helger.commons.io.stream.StreamHelper; -import com.helger.commons.random.RandomHelper; -import com.helger.commons.ws.TrustManagerTrustAll; -import com.helger.httpclient.HttpClientFactory; -import com.helger.settings.ISettings; - -/** - * The test classes for the usermessage, are split up for a better overview. - * Since all these classes need the same setup and a helper method, this class - * was created. Also with the help of Parameterized.class, each test will be - * done for both SOAP Versions. - * - * @author bayerlma - */ -public abstract class AbstractClientSetUp -{ - protected static final org.slf4j.Logger LOG = org.slf4j.LoggerFactory.getLogger (AbstractClientSetUp.class); - - protected ISettings m_aSettings; - protected int m_nStatusCode; - protected String m_sResponse; - protected CloseableHttpClient m_aClient; - protected HttpPost m_aPost; - - @Before - public void setUp () throws KeyManagementException, NoSuchAlgorithmException - { - AS4ServerConfiguration.reinitForTestOnly (); - - m_aSettings = AS4ServerConfiguration.getSettings (); - final String sURL = m_aSettings.getAsString ("server.address", "http://localhost:8080/as4"); - - LOG.info ("The following test case will only work if there is a local AS4 server running @ " + sURL); - final SSLContext aSSLContext = SSLContext.getInstance ("TLS"); - aSSLContext.init (null, new TrustManager [] { new TrustManagerTrustAll (false) }, RandomHelper.getSecureRandom ()); - - m_aClient = new HttpClientFactory (aSSLContext) - { - @Override - @Nonnull - public RequestConfig createRequestConfig () - { - return RequestConfig.custom () - .setCookieSpec (CookieSpecs.DEFAULT) - .setSocketTimeout (100_000) - .setConnectTimeout (5_000) - .setConnectionRequestTimeout (5_000) - .setCircularRedirectsAllowed (false) - .setRedirectsEnabled (true) - .build (); - } - }.createHttpClient (); - - m_aPost = new HttpPost (sURL); - - if (m_aSettings.getAsBoolean ("server.proxy.enabled", false)) - { - m_aPost.setConfig (RequestConfig.custom () - .setProxy (new HttpHost (m_aSettings.getAsString ("server.proxy.address"), - m_aSettings.getAsInt ("server.proxy.port"))) - .build ()); - } - - for (final ESOAPVersion e : ESOAPVersion.values ()) - { - final PMode aPMode = MockPModeGenerator.getTestPModeWithSecurity (e); - if (!MetaAS4Manager.getPModeMgr ().containsWithID (aPMode.getID ())) - MetaAS4Manager.getPModeMgr ().createOrUpdatePMode (aPMode); - } - } - - @After - public void after () - { - if (m_aClient != null) - { - StreamHelper.close (m_aClient); - m_aClient = null; - } - } -} +/** + * Copyright (C) 2015-2017 Philip Helger (www.helger.com) + * philip[at]helger[dot]com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.helger.as4.server; + +import java.security.KeyManagementException; +import java.security.NoSuchAlgorithmException; + +import javax.annotation.Nonnull; +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; + +import org.apache.http.HttpHost; +import org.apache.http.client.config.CookieSpecs; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.impl.client.CloseableHttpClient; +import org.junit.After; +import org.junit.Before; + +import com.helger.as4.mock.MockPModeGenerator; +import com.helger.as4.servlet.mgr.AS4ServerConfiguration; +import com.helger.commons.io.stream.StreamHelper; +import com.helger.commons.random.RandomHelper; +import com.helger.commons.ws.TrustManagerTrustAll; +import com.helger.httpclient.HttpClientFactory; +import com.helger.settings.ISettings; + +/** + * The test classes for the usermessage, are split up for a better overview. + * Since all these classes need the same setup and a helper method, this class + * was created. Also with the help of Parameterized.class, each test will be + * done for both SOAP Versions. + * + * @author bayerlma + */ +public abstract class AbstractClientSetUp +{ + protected static final org.slf4j.Logger LOG = org.slf4j.LoggerFactory.getLogger (AbstractClientSetUp.class); + + protected ISettings m_aSettings; + protected int m_nStatusCode; + protected String m_sResponse; + protected CloseableHttpClient m_aClient; + protected HttpPost m_aPost; + + @Before + public void setUp () throws KeyManagementException, NoSuchAlgorithmException + { + AS4ServerConfiguration.reinitForTestOnly (); + + m_aSettings = AS4ServerConfiguration.getSettings (); + final String sURL = m_aSettings.getAsString ("server.address", "http://localhost:8080/as4"); + + LOG.info ("The following test case will only work if there is a local AS4 server running @ " + sURL); + final SSLContext aSSLContext = SSLContext.getInstance ("TLS"); + aSSLContext.init (null, new TrustManager [] { new TrustManagerTrustAll (false) }, RandomHelper.getSecureRandom ()); + + m_aClient = new HttpClientFactory (aSSLContext) + { + @Override + @Nonnull + public RequestConfig createRequestConfig () + { + return RequestConfig.custom () + .setCookieSpec (CookieSpecs.DEFAULT) + .setSocketTimeout (100_000) + .setConnectTimeout (5_000) + .setConnectionRequestTimeout (5_000) + .setCircularRedirectsAllowed (false) + .setRedirectsEnabled (true) + .build (); + } + }.createHttpClient (); + + m_aPost = new HttpPost (sURL); + + if (m_aSettings.getAsBoolean ("server.proxy.enabled", false)) + { + m_aPost.setConfig (RequestConfig.custom () + .setProxy (new HttpHost (m_aSettings.getAsString ("server.proxy.address"), + m_aSettings.getAsInt ("server.proxy.port"))) + .build ()); + } + + // Create the mock PModes + MockPModeGenerator.ensureMockPModesArePresent (); + } + + @After + public void after () + { + if (m_aClient != null) + { + StreamHelper.close (m_aClient); + m_aClient = null; + } + } +} diff --git a/ph-as4-server-webapp-demo/src/test/resources/testfiles/WrongCompression.mime b/ph-as4-server-webapp-demo/src/test/resources/testfiles/WrongCompression.mime index 1e09fb1c0..224da922a 100644 --- a/ph-as4-server-webapp-demo/src/test/resources/testfiles/WrongCompression.mime +++ b/ph-as4-server-webapp-demo/src/test/resources/testfiles/WrongCompression.mime @@ -8,7 +8,7 @@ Content-Type: multipart/related; Content-Type: application/soap+xml;charset=UTF-8 Content-Transfer-Encoding: binary -2016-12-21T11:01:16.795+01:00c42e883b-aab1-47bf-b2f4-4e89ce309591@ph-as4APP_1000000101http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/senderAPP_1000000101http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/responderhttp://agreements.holodeckb2b.org/examples/agreement0QuoteToCollectNewPurchaseOrder4321C1-testC4-testapplication/xmlapplication/rar +2016-12-21T11:01:16.795+01:00c42e883b-aab1-47bf-b2f4-4e89ce309591@ph-as4APP_1000000101http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/senderAPP_1000000101http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/responderhttp://agreements.holodeckb2b.org/examples/agreement0QuoteToCollectNewPurchaseOrder4321C1-testC4-testapplication/xmlapplication/rar ------=_Part_0_581318631.1482314477236 Content-Type: application/xml Content-Transfer-Encoding: base64 diff --git a/ph-as4-server-webapp-demo/src/test/resources/testfiles/WrongSigningAlgorithm.xml b/ph-as4-server-webapp-demo/src/test/resources/testfiles/WrongSigningAlgorithm.xml index 8c503edcb..3d68c22ce 100644 --- a/ph-as4-server-webapp-demo/src/test/resources/testfiles/WrongSigningAlgorithm.xml +++ b/ph-as4-server-webapp-demo/src/test/resources/testfiles/WrongSigningAlgorithm.xml @@ -1,4 +1,4 @@ -MIIEhTCCA22gAwIBAgIQV89muarYc7GGAzfaMbEjUjANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQGEwJESzEnMCUGA1UEChMeTkFUSU9OQUwgSVQgQU5EIFRFTEVDT00gQUdFTkNZMR8wHQYDVQQLExZGT1IgVEVTVCBQVVJQT1NFUyBPTkxZMSQwIgYDVQQDExtQRVBQT0wgQUNDRVNTIFBPSU5UIFRFU1QgQ0EwHhcNMTUwMzA2MDAwMDAwWhcNMTcwMzA1MjM1OTU5WjBXMQswCQYDVQQGEwJBVDEvMC0GA1UECgwmQlJaIChGZWRlcmFsIENvbXB1dGluZyBDZW50ZXIgQXVzdHJpYSkxF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X0UvDKED7e4bSZGOYJRC6BAGn4xCSxK4B6rmGWt1RtlFvMjf0GyFRgb5HKVkOQCauFOUp543EKFKWkBTfFURRenBo1MDYAmofo0RnJ81qPbhYQSfpsqSANDXmogPU3C3M/cAQjkMQjZWiUG2zrMgUGYvmCZr8=GlcETdvXNgAl6zXOrnhobpDdPHx21x1ve45LmflbcofSS1JaOzIz7LNl+jLUCHTYX+/NKxK/5b4VBxDhhcwuvKpHaUCFyZCMu+6G0ixbT4RJTwz+6teNBCvkbqvE2Gaf7QWxVUjkMm24HbCEVd+F47MhTRKpy0KL9SgdWqJ2eu7KXsxIzYJ6yvZrnY2h7CEO1r31TArN0CLr7r5ddKfZ4OLGPc+fbUTY9hb/UltIy/87STsSt5eYBuaDQq7cZY83zt2M/TiQWf5c9uKfwY4vLIG8oHHbUq7uBBeaG5elyKT/mOzmqQptEvZ9vjuPo9xrKhPeP3UiXELpcwLrQWeCJg==2016-12-21T11:34:22.462+01:000c5307dc-5f80-49f5-94ac-2422a8e0d595@ph-as4APP_1000000101http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/senderAPP_1000000101http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/responderhttp://agreements.holodeckb2b.org/examples/agreement0QuoteToCollectNewPurchaseOrder4321C1-testC4-test + +MIIEhTCCA22gAwIBAgIQV89muarYc7GGAzfaMbEjUjANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQGEwJESzEnMCUGA1UEChMeTkFUSU9OQUwgSVQgQU5EIFRFTEVDT00gQUdFTkNZMR8wHQYDVQQLExZGT1IgVEVTVCBQVVJQT1NFUyBPTkxZMSQwIgYDVQQDExtQRVBQT0wgQUNDRVNTIFBPSU5UIFRFU1QgQ0EwHhcNMTUwMzA2MDAwMDAwWhcNMTcwMzA1MjM1OTU5WjBXMQswCQYDVQQGEwJBVDEvMC0GA1UECgwmQlJaIChGZWRlcmFsIENvbXB1dGluZyBDZW50ZXIgQXVzdHJpYSkxF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X0UvDKED7e4bSZGOYJRC6BAGn4xCSxK4B6rmGWt1RtlFvMjf0GyFRgb5HKVkOQCauFOUp543EKFKWkBTfFURRenBo1MDYAmofo0RnJ81qPbhYQSfpsqSANDXmogPU3C3M/cAQjkMQjZWiUG2zrMgUGYvmCZr8=GlcETdvXNgAl6zXOrnhobpDdPHx21x1ve45LmflbcofSS1JaOzIz7LNl+jLUCHTYX+/NKxK/5b4VBxDhhcwuvKpHaUCFyZCMu+6G0ixbT4RJTwz+6teNBCvkbqvE2Gaf7QWxVUjkMm24HbCEVd+F47MhTRKpy0KL9SgdWqJ2eu7KXsxIzYJ6yvZrnY2h7CEO1r31TArN0CLr7r5ddKfZ4OLGPc+fbUTY9hb/UltIy/87STsSt5eYBuaDQq7cZY83zt2M/TiQWf5c9uKfwY4vLIG8oHHbUq7uBBeaG5elyKT/mOzmqQptEvZ9vjuPo9xrKhPeP3UiXELpcwLrQWeCJg==2016-12-21T11:34:22.462+01:000c5307dc-5f80-49f5-94ac-2422a8e0d595@ph-as4APP_1000000101http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/senderAPP_1000000101http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/responderhttp://agreements.holodeckb2b.org/examples/agreement0QuoteToCollectNewPurchaseOrder4321C1-testC4-test 1.0 diff --git a/ph-as4-server-webapp-demo/src/test/resources/testfiles/WrongSigningDigestAlgorithm.xml b/ph-as4-server-webapp-demo/src/test/resources/testfiles/WrongSigningDigestAlgorithm.xml index d25df197b..39f8dec01 100644 --- a/ph-as4-server-webapp-demo/src/test/resources/testfiles/WrongSigningDigestAlgorithm.xml +++ b/ph-as4-server-webapp-demo/src/test/resources/testfiles/WrongSigningDigestAlgorithm.xml @@ -1,4 +1,4 @@ -MIIEhTCCA22gAwIBAgIQV89muarYc7GGAzfaMbEjUjANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQGEwJESzEnMCUGA1UEChMeTkFUSU9OQUwgSVQgQU5EIFRF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qGSIb3DQEBCwUAA4IBAQBagbfyISlRfqH6VsPZo14W+X5E/H0UjvGMwp1wlEFA8AzhIztqKWbVnS84vF2F0UqRrh44BHnwZmMhjnnHRqYdvzUDGNAiM2zPl0tDDb/RkLRfXHaXVA/kjaAYPzagq2N23vDEiz2G1ZKb9ufD+en8mbdmzpyIPVqbzc/qcitUOS9E70wUT3hx7wj54UN8j3jibWArz6/jC8RSL1AlVKISU2NxrIX3O1sBbxX0UvDKED7e4bSZGOYJRC6BAGn4xCSxK4B6rmGWt1RtlFvMjf0GyFRgb5HKVkOQCauFOUp543EKFKWkBTfFURRenBo1MDYAmofo0RnJ81qPbhYQSfpsqSANDXmogPU3C3M/cAQjkMQjZWiUG2zrMgUGYvmCZr8=GlcETdvXNgAl6zXOrnhobpDdPHx21x1ve45LmflbcofSS1JaOzIz7LNl+jLUCHTYX+/NKxK/5b4VBxDhhcwuvKpHaUCFyZCMu+6G0ixbT4RJTwz+6teNBCvkbqvE2Gaf7QWxVUjkMm24HbCEVd+F47MhTRKpy0KL9SgdWqJ2eu7KXsxIzYJ6yvZrnY2h7CEO1r31TArN0CLr7r5ddKfZ4OLGPc+fbUTY9hb/UltIy/87STsSt5eYBuaDQq7cZY83zt2M/TiQWf5c9uKfwY4vLIG8oHHbUq7uBBeaG5elyKT/mOzmqQptEvZ9vjuPo9xrKhPeP3UiXELpcwLrQWeCJg==2016-12-21T11:34:22.462+01:000c5307dc-5f80-49f5-94ac-2422a8e0d595@ph-as4APP_1000000101http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/senderAPP_1000000101http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/responderhttp://agreements.holodeckb2b.org/examples/agreement0QuoteToCollectNewPurchaseOrder4321C1-testC4-test + +MIIEhTCCA22gAwIBAgIQV89muarYc7GGAzfaMbEjUjANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQGEwJESzEnMCUGA1UEChMeTkFUSU9OQUwgSVQgQU5EIFRF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qGSIb3DQEBCwUAA4IBAQBagbfyISlRfqH6VsPZo14W+X5E/H0UjvGMwp1wlEFA8AzhIztqKWbVnS84vF2F0UqRrh44BHnwZmMhjnnHRqYdvzUDGNAiM2zPl0tDDb/RkLRfXHaXVA/kjaAYPzagq2N23vDEiz2G1ZKb9ufD+en8mbdmzpyIPVqbzc/qcitUOS9E70wUT3hx7wj54UN8j3jibWArz6/jC8RSL1AlVKISU2NxrIX3O1sBbxX0UvDKED7e4bSZGOYJRC6BAGn4xCSxK4B6rmGWt1RtlFvMjf0GyFRgb5HKVkOQCauFOUp543EKFKWkBTfFURRenBo1MDYAmofo0RnJ81qPbhYQSfpsqSANDXmogPU3C3M/cAQjkMQjZWiUG2zrMgUGYvmCZr8=GlcETdvXNgAl6zXOrnhobpDdPHx21x1ve45LmflbcofSS1JaOzIz7LNl+jLUCHTYX+/NKxK/5b4VBxDhhcwuvKpHaUCFyZCMu+6G0ixbT4RJTwz+6teNBCvkbqvE2Gaf7QWxVUjkMm24HbCEVd+F47MhTRKpy0KL9SgdWqJ2eu7KXsxIzYJ6yvZrnY2h7CEO1r31TArN0CLr7r5ddKfZ4OLGPc+fbUTY9hb/UltIy/87STsSt5eYBuaDQq7cZY83zt2M/TiQWf5c9uKfwY4vLIG8oHHbUq7uBBeaG5elyKT/mOzmqQptEvZ9vjuPo9xrKhPeP3UiXELpcwLrQWeCJg==2016-12-21T11:34:22.462+01:000c5307dc-5f80-49f5-94ac-2422a8e0d595@ph-as4APP_1000000101http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/senderAPP_1000000101http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/responderhttp://agreements.holodeckb2b.org/examples/agreement0QuoteToCollectNewPurchaseOrder4321C1-testC4-test 1.0