use of com.helger.phase4.http.HttpXMLEntity in project phase4 by phax.
the class ErrorMessageTest method testSendErrorMessageNoRefToMessageID.
@Test
@Ignore("Allowed since 0.9.14")
public void testSendErrorMessageNoRefToMessageID() throws Exception {
final Document aDoc = DOMReader.readXMLDOM(new ClassPathResource("testfiles/ErrorMessageNoRefToMessageID.xml"));
sendPlainMessageAndWait(new HttpXMLEntity(aDoc, ESoapVersion.SOAP_12.getMimeType()), false, EEbmsError.EBMS_VALUE_INCONSISTENT.getErrorCode());
}
use of com.helger.phase4.http.HttpXMLEntity in project phase4 by phax.
the class PModeCheckTest method testPModeLegNullReject.
@Test
public void testPModeLegNullReject() throws Exception {
final PMode aPMode = MockPModeGenerator.getTestPMode(SOAP_VERSION);
aPMode.setLeg1(null);
final IPModeManager aPModeMgr = MetaAS4Manager.getPModeMgr();
// Needed since different ids set in message and pmode otherwise
m_aEbms3UserMessage.setCollaborationInfo(MessageHelperMethods.createEbms3CollaborationInfo(aPMode.getInitiatorID() + "-" + aPMode.getResponderID(), DEFAULT_AGREEMENT, null, CAS4.DEFAULT_SERVICE_URL, CAS4.DEFAULT_ACTION_URL, AS4TestConstants.TEST_CONVERSATION_ID));
try {
for (final String sPModeID : aPModeMgr.getAllIDs()) {
aPModeMgr.deletePMode(sPModeID);
}
assertTrue(aPModeMgr.getAllIDs().isEmpty());
aPModeMgr.createOrUpdatePMode(aPMode);
final AS4UserMessage aMsg = AS4UserMessage.create(SOAP_VERSION, m_aEbms3UserMessage).setMustUnderstand(true);
final Document aSignedDoc = AS4Signer.createSignedMessage(m_aCryptoFactory, aMsg.getAsSoapDocument(m_aPayload), SOAP_VERSION, aMsg.getMessagingID(), null, s_aResMgr, false, AS4SigningParams.createDefault());
sendPlainMessageAndWait(new HttpXMLEntity(aSignedDoc, SOAP_VERSION.getMimeType()), false, EEbmsError.EBMS_PROCESSING_MODE_MISMATCH.getErrorCode());
} finally {
// The MockPModeGenerator generates automatically a PMode, we need
// too delete it after we are done with the test
aPModeMgr.deletePMode(aPMode.getID());
}
}
use of com.helger.phase4.http.HttpXMLEntity in project phase4 by phax.
the class PModeCheckTest method testUserMessageDifferentPropertiesValues.
@Test
public void testUserMessageDifferentPropertiesValues() throws Exception {
final Ebms3MessageProperties aEbms3MessageProperties = new Ebms3MessageProperties();
final ICommonsList<Ebms3Property> aEbms3Properties = new CommonsArrayList<>();
aEbms3Properties.add(_createRandomProperty());
aEbms3MessageProperties.setProperty(aEbms3Properties);
m_aEbms3UserMessage.setMessageProperties(aEbms3MessageProperties);
final Document aDoc = AS4UserMessage.create(SOAP_VERSION, m_aEbms3UserMessage).setMustUnderstand(true).getAsSoapDocument(m_aPayload);
sendPlainMessageAndWait(new HttpXMLEntity(aDoc, SOAP_VERSION.getMimeType()), false, "");
}
use of com.helger.phase4.http.HttpXMLEntity in project phase4 by phax.
the class PullRequestTest method testSendPullRequestFailure.
@Test
public void testSendPullRequestFailure() throws Exception {
// Special MPC name handled in MockMessageProcessorSPI
final String sFailure = MockMessageProcessorSPI.MPC_FAILURE;
final MPC aMPC = new MPC(sFailure);
if (MetaAS4Manager.getMPCMgr().getMPCOfID(sFailure) == null)
MetaAS4Manager.getMPCMgr().createMPC(aMPC);
final Document aDoc = AS4PullRequestMessage.create(m_eSoapVersion, MessageHelperMethods.createEbms3MessageInfo(), sFailure, null).getAsSoapDocument();
final HttpEntity aEntity = new HttpXMLEntity(aDoc, m_eSoapVersion.getMimeType());
sendPlainMessageAndWait(aEntity, false, EEbmsError.EBMS_OTHER.getErrorCode());
}
use of com.helger.phase4.http.HttpXMLEntity in project phase4 by phax.
the class PullRequestTest method testSendPullRequestEmpty.
@Test
public void testSendPullRequestEmpty() throws Exception {
// Special MPC name handled in MockMessageProcessorSPI
final String sFailure = MockMessageProcessorSPI.MPC_EMPTY;
final MPC aMPC = new MPC(sFailure);
if (MetaAS4Manager.getMPCMgr().getMPCOfID(sFailure) == null)
MetaAS4Manager.getMPCMgr().createMPC(aMPC);
final Document aDoc = AS4PullRequestMessage.create(m_eSoapVersion, MessageHelperMethods.createEbms3MessageInfo(), sFailure, null).getAsSoapDocument();
final HttpEntity aEntity = new HttpXMLEntity(aDoc, m_eSoapVersion.getMimeType());
sendPlainMessageAndWait(aEntity, false, EEbmsError.EBMS_EMPTY_MESSAGE_PARTITION_CHANNEL.getErrorCode());
}
Aggregations