use of com.helger.phase4.http.HttpXMLEntity in project phase4 by phax.
the class PModeCheckTest method testNullPModeID.
@Test
public void testNullPModeID() throws Exception {
m_aEbms3UserMessage.getCollaborationInfo().getAgreementRef().setPmode(null);
// Needed to set since also Action and Service combination gets checked if
// they are already in the pmode pool
final Ebms3Service aService = new Ebms3Service();
aService.setValue("urn:www.cenbii.eu:profile:bii04:ver2.0");
aService.setType("cenbii-procid-ubl");
m_aEbms3UserMessage.getCollaborationInfo().setService(aService);
m_aEbms3UserMessage.getCollaborationInfo().setAction("urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:www.cenbii.eu:transaction:biitrns010:ver2.0:extended:urn:www.peppol.eu:bis:peppol4a:ver2.0::2.1");
final Document aDoc = AS4UserMessage.create(SOAP_VERSION, m_aEbms3UserMessage).setMustUnderstand(true).getAsSoapDocument(m_aPayload);
assertNotNull(aDoc);
sendPlainMessageAndWait(new HttpXMLEntity(aDoc, SOAP_VERSION.getMimeType()), true, null);
}
use of com.helger.phase4.http.HttpXMLEntity in project phase4 by phax.
the class PModePingTest method testUsePModePingSuccessful.
// Can only check success, since we cannot check if SPIs got called or not
@Test
public void testUsePModePingSuccessful() throws Exception {
final Document aDoc = modifyUserMessage(null, null, null, createDefaultProperties(), null, null, null);
sendPlainMessageAndWait(new HttpXMLEntity(aDoc, ESoapVersion.AS4_DEFAULT.getMimeType()), true, null);
}
use of com.helger.phase4.http.HttpXMLEntity in project phase4 by phax.
the class PullRequestTest method testSendPullRequestSuccessTwoWayPullPush.
@Test
public void testSendPullRequestSuccessTwoWayPullPush() throws Exception {
// Depending on the payload a different EMEPBinding get chosen by
// @MockPullRequestProcessorSPI
// To Test the pull request part of the EMEPBinding
final Document aPayload = DOMReader.readXMLDOM(new ClassPathResource("testfiles/PullPush.xml"));
final ICommonsList<Object> aAny = new CommonsArrayList<>();
aAny.add(aPayload.getDocumentElement());
final Document aDoc = AS4PullRequestMessage.create(m_eSoapVersion, MessageHelperMethods.createEbms3MessageInfo(), AS4TestConstants.DEFAULT_MPC, aAny).getAsSoapDocument();
final HttpEntity aEntity = new HttpXMLEntity(aDoc, m_eSoapVersion.getMimeType());
final String sResponse = sendPlainMessageAndWait(aEntity, true, null);
assertTrue(sResponse.contains(AS4TestConstants.USERMESSAGE_ASSERTCHECK));
}
use of com.helger.phase4.http.HttpXMLEntity in project phase4 by phax.
the class PullRequestTest method testSendPullRequestWithNoMPC.
@Test
public void testSendPullRequestWithNoMPC() throws Exception {
final Document aDoc = AS4PullRequestMessage.create(m_eSoapVersion, MessageHelperMethods.createEbms3MessageInfo(), null, null).getAsSoapDocument();
final HttpEntity aEntity = new HttpXMLEntity(aDoc, m_eSoapVersion.getMimeType());
sendPlainMessageAndWait(aEntity, false, EEbmsError.EBMS_VALUE_NOT_RECOGNIZED.getErrorCode());
}
use of com.helger.phase4.http.HttpXMLEntity in project phase4 by phax.
the class PullRequestTest method testSendPullRequestSuccess.
@Test
public void testSendPullRequestSuccess() throws Exception {
final AS4PullRequestMessage aPullReqMsg = AS4PullRequestMessage.create(m_eSoapVersion, MessageHelperMethods.createEbms3MessageInfo(), AS4TestConstants.DEFAULT_MPC, null);
Document aDoc = aPullReqMsg.getAsSoapDocument();
final boolean bMustUnderstand = true;
aDoc = AS4Signer.createSignedMessage(m_aCryptoFactory, aDoc, m_eSoapVersion, aPullReqMsg.getMessagingID(), null, s_aResMgr, bMustUnderstand, AS4SigningParams.createDefault());
final HttpEntity aEntity = new HttpXMLEntity(aDoc, m_eSoapVersion.getMimeType());
final String sResponse = sendPlainMessageAndWait(aEntity, true, null);
assertTrue(sResponse.contains(AS4TestConstants.USERMESSAGE_ASSERTCHECK));
}
Aggregations