Search in sources :

Example 6 with PModeLeg

use of com.helger.phase4.model.pmode.leg.PModeLeg in project phase4 by phax.

the class CEFCompatibilityValidatorTest method testValidatePModeNoProtocol.

@Test
public void testValidatePModeNoProtocol() {
    m_aPMode.setLeg1(new PModeLeg(null, null, null, null, null));
    VALIDATOR.validatePMode(m_aPMode, m_aErrorList);
    assertTrue(m_aErrorList.containsAny(x -> x.getErrorText(LOCALE).contains("Protocol is missing")));
}
Also used : Ebms3SignalMessage(com.helger.phase4.ebms3header.Ebms3SignalMessage) PModeLegSecurity(com.helger.phase4.model.pmode.leg.PModeLegSecurity) MessageHelperMethods(com.helger.phase4.messaging.domain.MessageHelperMethods) EMEP(com.helger.phase4.model.EMEP) ErrorList(com.helger.commons.error.list.ErrorList) ETriState(com.helger.commons.state.ETriState) ESoapVersion(com.helger.phase4.soap.ESoapVersion) Assert.assertNotSame(org.junit.Assert.assertNotSame) EPModeSendReceiptReplyPattern(com.helger.phase4.model.pmode.leg.EPModeSendReceiptReplyPattern) ECryptoAlgorithmSign(com.helger.phase4.crypto.ECryptoAlgorithmSign) Locale(java.util.Locale) Ebms3MessageInfo(com.helger.phase4.ebms3header.Ebms3MessageInfo) PMode(com.helger.phase4.model.pmode.PMode) PModeLeg(com.helger.phase4.model.pmode.leg.PModeLeg) ClassRule(org.junit.ClassRule) PModeLegErrorHandling(com.helger.phase4.model.pmode.leg.PModeLegErrorHandling) PhotonAppWebTestRule(com.helger.photon.app.mock.PhotonAppWebTestRule) Before(org.junit.Before) Ebms3PartyId(com.helger.phase4.ebms3header.Ebms3PartyId) PModeLegProtocol(com.helger.phase4.model.pmode.leg.PModeLegProtocol) Ebms3UserMessage(com.helger.phase4.ebms3header.Ebms3UserMessage) ECryptoAlgorithmSignDigest(com.helger.phase4.crypto.ECryptoAlgorithmSignDigest) EWSSVersion(com.helger.phase4.wss.EWSSVersion) Assert.assertTrue(org.junit.Assert.assertTrue) EMEPBinding(com.helger.phase4.model.EMEPBinding) Test(org.junit.Test) Ebms3To(com.helger.phase4.ebms3header.Ebms3To) ECryptoAlgorithmCrypt(com.helger.phase4.crypto.ECryptoAlgorithmCrypt) Ebms3From(com.helger.phase4.ebms3header.Ebms3From) Ignore(org.junit.Ignore) Ebms3PartyInfo(com.helger.phase4.ebms3header.Ebms3PartyInfo) IPModeIDProvider(com.helger.phase4.model.pmode.IPModeIDProvider) PModeLeg(com.helger.phase4.model.pmode.leg.PModeLeg) Test(org.junit.Test)

Example 7 with PModeLeg

use of com.helger.phase4.model.pmode.leg.PModeLeg in project phase4 by phax.

the class CEFCompatibilityValidatorTest method testValidatePModeErrorHandlingMandatory.

// Error Handling
@Test
public void testValidatePModeErrorHandlingMandatory() {
    m_aPMode.setLeg1(new PModeLeg(PModeLegProtocol.createForDefaultSoapVersion("http://test.example.org"), null, null, null, null));
    VALIDATOR.validatePMode(m_aPMode, m_aErrorList);
    assertTrue(m_aErrorList.containsAny(x -> x.getErrorText(LOCALE).contains("PMode.Leg[1].ErrorHandling is missing")));
}
Also used : Ebms3SignalMessage(com.helger.phase4.ebms3header.Ebms3SignalMessage) PModeLegSecurity(com.helger.phase4.model.pmode.leg.PModeLegSecurity) MessageHelperMethods(com.helger.phase4.messaging.domain.MessageHelperMethods) EMEP(com.helger.phase4.model.EMEP) ErrorList(com.helger.commons.error.list.ErrorList) ETriState(com.helger.commons.state.ETriState) ESoapVersion(com.helger.phase4.soap.ESoapVersion) Assert.assertNotSame(org.junit.Assert.assertNotSame) EPModeSendReceiptReplyPattern(com.helger.phase4.model.pmode.leg.EPModeSendReceiptReplyPattern) ECryptoAlgorithmSign(com.helger.phase4.crypto.ECryptoAlgorithmSign) Locale(java.util.Locale) Ebms3MessageInfo(com.helger.phase4.ebms3header.Ebms3MessageInfo) PMode(com.helger.phase4.model.pmode.PMode) PModeLeg(com.helger.phase4.model.pmode.leg.PModeLeg) ClassRule(org.junit.ClassRule) PModeLegErrorHandling(com.helger.phase4.model.pmode.leg.PModeLegErrorHandling) PhotonAppWebTestRule(com.helger.photon.app.mock.PhotonAppWebTestRule) Before(org.junit.Before) Ebms3PartyId(com.helger.phase4.ebms3header.Ebms3PartyId) PModeLegProtocol(com.helger.phase4.model.pmode.leg.PModeLegProtocol) Ebms3UserMessage(com.helger.phase4.ebms3header.Ebms3UserMessage) ECryptoAlgorithmSignDigest(com.helger.phase4.crypto.ECryptoAlgorithmSignDigest) EWSSVersion(com.helger.phase4.wss.EWSSVersion) Assert.assertTrue(org.junit.Assert.assertTrue) EMEPBinding(com.helger.phase4.model.EMEPBinding) Test(org.junit.Test) Ebms3To(com.helger.phase4.ebms3header.Ebms3To) ECryptoAlgorithmCrypt(com.helger.phase4.crypto.ECryptoAlgorithmCrypt) Ebms3From(com.helger.phase4.ebms3header.Ebms3From) Ignore(org.junit.Ignore) Ebms3PartyInfo(com.helger.phase4.ebms3header.Ebms3PartyInfo) IPModeIDProvider(com.helger.phase4.model.pmode.IPModeIDProvider) PModeLeg(com.helger.phase4.model.pmode.leg.PModeLeg) Test(org.junit.Test)

Example 8 with PModeLeg

use of com.helger.phase4.model.pmode.leg.PModeLeg in project phase4 by phax.

the class CEFCompatibilityValidatorTest method testValidatePModeSecurityWrongX509SignatureHashFunction.

@Test
public void testValidatePModeSecurityWrongX509SignatureHashFunction() {
    final PModeLegSecurity aSecurityLeg = m_aPMode.getLeg1().getSecurity();
    aSecurityLeg.setX509SignatureHashFunction(ECryptoAlgorithmSignDigest.DIGEST_SHA_512);
    m_aPMode.setLeg1(new PModeLeg(PModeLegProtocol.createForDefaultSoapVersion("http://test.example.org"), null, null, null, aSecurityLeg));
    VALIDATOR.validatePMode(m_aPMode, m_aErrorList);
    assertTrue(m_aErrorList.containsAny(x -> x.getErrorText(LOCALE).contains(ECryptoAlgorithmSignDigest.DIGEST_SHA_256.getID())));
}
Also used : Ebms3SignalMessage(com.helger.phase4.ebms3header.Ebms3SignalMessage) PModeLegSecurity(com.helger.phase4.model.pmode.leg.PModeLegSecurity) MessageHelperMethods(com.helger.phase4.messaging.domain.MessageHelperMethods) EMEP(com.helger.phase4.model.EMEP) ErrorList(com.helger.commons.error.list.ErrorList) ETriState(com.helger.commons.state.ETriState) ESoapVersion(com.helger.phase4.soap.ESoapVersion) Assert.assertNotSame(org.junit.Assert.assertNotSame) EPModeSendReceiptReplyPattern(com.helger.phase4.model.pmode.leg.EPModeSendReceiptReplyPattern) ECryptoAlgorithmSign(com.helger.phase4.crypto.ECryptoAlgorithmSign) Locale(java.util.Locale) Ebms3MessageInfo(com.helger.phase4.ebms3header.Ebms3MessageInfo) PMode(com.helger.phase4.model.pmode.PMode) PModeLeg(com.helger.phase4.model.pmode.leg.PModeLeg) ClassRule(org.junit.ClassRule) PModeLegErrorHandling(com.helger.phase4.model.pmode.leg.PModeLegErrorHandling) PhotonAppWebTestRule(com.helger.photon.app.mock.PhotonAppWebTestRule) Before(org.junit.Before) Ebms3PartyId(com.helger.phase4.ebms3header.Ebms3PartyId) PModeLegProtocol(com.helger.phase4.model.pmode.leg.PModeLegProtocol) Ebms3UserMessage(com.helger.phase4.ebms3header.Ebms3UserMessage) ECryptoAlgorithmSignDigest(com.helger.phase4.crypto.ECryptoAlgorithmSignDigest) EWSSVersion(com.helger.phase4.wss.EWSSVersion) Assert.assertTrue(org.junit.Assert.assertTrue) EMEPBinding(com.helger.phase4.model.EMEPBinding) Test(org.junit.Test) Ebms3To(com.helger.phase4.ebms3header.Ebms3To) ECryptoAlgorithmCrypt(com.helger.phase4.crypto.ECryptoAlgorithmCrypt) Ebms3From(com.helger.phase4.ebms3header.Ebms3From) Ignore(org.junit.Ignore) Ebms3PartyInfo(com.helger.phase4.ebms3header.Ebms3PartyInfo) IPModeIDProvider(com.helger.phase4.model.pmode.IPModeIDProvider) PModeLeg(com.helger.phase4.model.pmode.leg.PModeLeg) PModeLegSecurity(com.helger.phase4.model.pmode.leg.PModeLegSecurity) Test(org.junit.Test)

Example 9 with PModeLeg

use of com.helger.phase4.model.pmode.leg.PModeLeg in project phase4 by phax.

the class CEFCompatibilityValidatorTest method testValidatePModeErrorHandlingReportDeliveryFailuresNotifyProducerMandatory.

@Test
public void testValidatePModeErrorHandlingReportDeliveryFailuresNotifyProducerMandatory() {
    final PModeLegErrorHandling aErrorHandler = PModeLegErrorHandling.createUndefined();
    m_aPMode.setLeg1(new PModeLeg(PModeLegProtocol.createForDefaultSoapVersion("http://test.example.org"), null, aErrorHandler, null, null));
    VALIDATOR.validatePMode(m_aPMode, m_aErrorList);
    assertTrue(m_aErrorList.containsAny(x -> x.getErrorText(LOCALE).contains("ErrorHandling.Report.ProcessErrorNotifyProducer is missing")));
}
Also used : Ebms3SignalMessage(com.helger.phase4.ebms3header.Ebms3SignalMessage) PModeLegSecurity(com.helger.phase4.model.pmode.leg.PModeLegSecurity) MessageHelperMethods(com.helger.phase4.messaging.domain.MessageHelperMethods) EMEP(com.helger.phase4.model.EMEP) ErrorList(com.helger.commons.error.list.ErrorList) ETriState(com.helger.commons.state.ETriState) ESoapVersion(com.helger.phase4.soap.ESoapVersion) Assert.assertNotSame(org.junit.Assert.assertNotSame) EPModeSendReceiptReplyPattern(com.helger.phase4.model.pmode.leg.EPModeSendReceiptReplyPattern) ECryptoAlgorithmSign(com.helger.phase4.crypto.ECryptoAlgorithmSign) Locale(java.util.Locale) Ebms3MessageInfo(com.helger.phase4.ebms3header.Ebms3MessageInfo) PMode(com.helger.phase4.model.pmode.PMode) PModeLeg(com.helger.phase4.model.pmode.leg.PModeLeg) ClassRule(org.junit.ClassRule) PModeLegErrorHandling(com.helger.phase4.model.pmode.leg.PModeLegErrorHandling) PhotonAppWebTestRule(com.helger.photon.app.mock.PhotonAppWebTestRule) Before(org.junit.Before) Ebms3PartyId(com.helger.phase4.ebms3header.Ebms3PartyId) PModeLegProtocol(com.helger.phase4.model.pmode.leg.PModeLegProtocol) Ebms3UserMessage(com.helger.phase4.ebms3header.Ebms3UserMessage) ECryptoAlgorithmSignDigest(com.helger.phase4.crypto.ECryptoAlgorithmSignDigest) EWSSVersion(com.helger.phase4.wss.EWSSVersion) Assert.assertTrue(org.junit.Assert.assertTrue) EMEPBinding(com.helger.phase4.model.EMEPBinding) Test(org.junit.Test) Ebms3To(com.helger.phase4.ebms3header.Ebms3To) ECryptoAlgorithmCrypt(com.helger.phase4.crypto.ECryptoAlgorithmCrypt) Ebms3From(com.helger.phase4.ebms3header.Ebms3From) Ignore(org.junit.Ignore) Ebms3PartyInfo(com.helger.phase4.ebms3header.Ebms3PartyInfo) IPModeIDProvider(com.helger.phase4.model.pmode.IPModeIDProvider) PModeLeg(com.helger.phase4.model.pmode.leg.PModeLeg) PModeLegErrorHandling(com.helger.phase4.model.pmode.leg.PModeLegErrorHandling) Test(org.junit.Test)

Example 10 with PModeLeg

use of com.helger.phase4.model.pmode.leg.PModeLeg in project phase4 by phax.

the class CEFCompatibilityValidatorTwoWayFuncTest method testValidatePModeNoProtocolAddress.

@Test
@Ignore("The response address is most of the time not set")
public void testValidatePModeNoProtocolAddress() {
    m_aPMode.setLeg2(new PModeLeg(PModeLegProtocol.createForDefaultSoapVersion(null), null, null, null, null));
    VALIDATOR.validatePMode(m_aPMode, m_aErrorList);
    assertTrue(m_aErrorList.containsAny(x -> x.getErrorText(LOCALE).contains("AddressProtocol is missing")));
}
Also used : Ebms3SignalMessage(com.helger.phase4.ebms3header.Ebms3SignalMessage) PModeLegSecurity(com.helger.phase4.model.pmode.leg.PModeLegSecurity) MessageHelperMethods(com.helger.phase4.messaging.domain.MessageHelperMethods) EMEP(com.helger.phase4.model.EMEP) ErrorList(com.helger.commons.error.list.ErrorList) ETriState(com.helger.commons.state.ETriState) ESoapVersion(com.helger.phase4.soap.ESoapVersion) Assert.assertNotSame(org.junit.Assert.assertNotSame) EPModeSendReceiptReplyPattern(com.helger.phase4.model.pmode.leg.EPModeSendReceiptReplyPattern) ECryptoAlgorithmSign(com.helger.phase4.crypto.ECryptoAlgorithmSign) Locale(java.util.Locale) Ebms3MessageInfo(com.helger.phase4.ebms3header.Ebms3MessageInfo) PMode(com.helger.phase4.model.pmode.PMode) PModeLeg(com.helger.phase4.model.pmode.leg.PModeLeg) ClassRule(org.junit.ClassRule) PModeLegErrorHandling(com.helger.phase4.model.pmode.leg.PModeLegErrorHandling) PhotonAppWebTestRule(com.helger.photon.app.mock.PhotonAppWebTestRule) Before(org.junit.Before) Ebms3PartyId(com.helger.phase4.ebms3header.Ebms3PartyId) PModeLegProtocol(com.helger.phase4.model.pmode.leg.PModeLegProtocol) Ebms3UserMessage(com.helger.phase4.ebms3header.Ebms3UserMessage) ECryptoAlgorithmSignDigest(com.helger.phase4.crypto.ECryptoAlgorithmSignDigest) EWSSVersion(com.helger.phase4.wss.EWSSVersion) Assert.assertTrue(org.junit.Assert.assertTrue) EMEPBinding(com.helger.phase4.model.EMEPBinding) Test(org.junit.Test) Ebms3To(com.helger.phase4.ebms3header.Ebms3To) ECryptoAlgorithmCrypt(com.helger.phase4.crypto.ECryptoAlgorithmCrypt) Ebms3From(com.helger.phase4.ebms3header.Ebms3From) Ignore(org.junit.Ignore) Ebms3PartyInfo(com.helger.phase4.ebms3header.Ebms3PartyInfo) IPModeIDProvider(com.helger.phase4.model.pmode.IPModeIDProvider) PModeLeg(com.helger.phase4.model.pmode.leg.PModeLeg) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

PModeLeg (com.helger.phase4.model.pmode.leg.PModeLeg)99 PMode (com.helger.phase4.model.pmode.PMode)91 PModeLegSecurity (com.helger.phase4.model.pmode.leg.PModeLegSecurity)89 EMEP (com.helger.phase4.model.EMEP)88 EMEPBinding (com.helger.phase4.model.EMEPBinding)88 Ebms3UserMessage (com.helger.phase4.ebms3header.Ebms3UserMessage)87 PModeLegErrorHandling (com.helger.phase4.model.pmode.leg.PModeLegErrorHandling)87 PModeLegProtocol (com.helger.phase4.model.pmode.leg.PModeLegProtocol)86 ESoapVersion (com.helger.phase4.soap.ESoapVersion)86 Before (org.junit.Before)86 Ebms3SignalMessage (com.helger.phase4.ebms3header.Ebms3SignalMessage)85 Locale (java.util.Locale)85 ErrorList (com.helger.commons.error.list.ErrorList)84 ECryptoAlgorithmSign (com.helger.phase4.crypto.ECryptoAlgorithmSign)84 ECryptoAlgorithmSignDigest (com.helger.phase4.crypto.ECryptoAlgorithmSignDigest)84 Ebms3MessageInfo (com.helger.phase4.ebms3header.Ebms3MessageInfo)84 Ebms3PartyId (com.helger.phase4.ebms3header.Ebms3PartyId)84 Ignore (org.junit.Ignore)84 Test (org.junit.Test)84 ETriState (com.helger.commons.state.ETriState)83