Search in sources :

Example 6 with Ebms3PartyId

use of com.helger.phase4.ebms3header.Ebms3PartyId in project phase4 by phax.

the class ENTSOGCompatibilityValidatorTest method testValidateUserMessageMoreThanOnePartyID.

@Test
public void testValidateUserMessageMoreThanOnePartyID() {
    final Ebms3PartyId aFirstId = MessageHelperMethods.createEbms3PartyId("type", "value");
    final Ebms3PartyId aSecondId = MessageHelperMethods.createEbms3PartyId("type2", "value2");
    final Ebms3From aFromPart = new Ebms3From();
    aFromPart.addPartyId(aFirstId);
    aFromPart.addPartyId(aSecondId);
    final Ebms3To aToPart = new Ebms3To();
    aToPart.addPartyId(aFirstId);
    aToPart.addPartyId(aSecondId);
    final Ebms3PartyInfo aPartyInfo = new Ebms3PartyInfo();
    aPartyInfo.setFrom(aFromPart);
    aPartyInfo.setTo(aToPart);
    final Ebms3UserMessage aUserMessage = new Ebms3UserMessage();
    aUserMessage.setPartyInfo(aPartyInfo);
    VALIDATOR.validateUserMessage(aUserMessage, m_aErrorList);
    assertTrue(m_aErrorList.containsAny(x -> x.getErrorText(LOCALE).contains("must contain no more than one PartyID")));
}
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) Ebms3PartyId(com.helger.phase4.ebms3header.Ebms3PartyId) Ebms3From(com.helger.phase4.ebms3header.Ebms3From) Ebms3To(com.helger.phase4.ebms3header.Ebms3To) Ebms3UserMessage(com.helger.phase4.ebms3header.Ebms3UserMessage) Ebms3PartyInfo(com.helger.phase4.ebms3header.Ebms3PartyInfo) Test(org.junit.Test)

Aggregations

Ebms3PartyId (com.helger.phase4.ebms3header.Ebms3PartyId)6 Ebms3MessageInfo (com.helger.phase4.ebms3header.Ebms3MessageInfo)5 Ebms3SignalMessage (com.helger.phase4.ebms3header.Ebms3SignalMessage)5 Ebms3UserMessage (com.helger.phase4.ebms3header.Ebms3UserMessage)5 PModeLeg (com.helger.phase4.model.pmode.leg.PModeLeg)5 Locale (java.util.Locale)5 ErrorList (com.helger.commons.error.list.ErrorList)4 ETriState (com.helger.commons.state.ETriState)4 ECryptoAlgorithmCrypt (com.helger.phase4.crypto.ECryptoAlgorithmCrypt)4 ECryptoAlgorithmSign (com.helger.phase4.crypto.ECryptoAlgorithmSign)4 ECryptoAlgorithmSignDigest (com.helger.phase4.crypto.ECryptoAlgorithmSignDigest)4 Ebms3From (com.helger.phase4.ebms3header.Ebms3From)4 Ebms3PartyInfo (com.helger.phase4.ebms3header.Ebms3PartyInfo)4 Ebms3To (com.helger.phase4.ebms3header.Ebms3To)4 MessageHelperMethods (com.helger.phase4.messaging.domain.MessageHelperMethods)4 EMEP (com.helger.phase4.model.EMEP)4 EMEPBinding (com.helger.phase4.model.EMEPBinding)4 IPModeIDProvider (com.helger.phase4.model.pmode.IPModeIDProvider)4 PMode (com.helger.phase4.model.pmode.PMode)4 EPModeSendReceiptReplyPattern (com.helger.phase4.model.pmode.leg.EPModeSendReceiptReplyPattern)4