public async Task Test_8_3_17_AS4Message_Gets_Delivered_To_Payload_Service() { // Arrange AS4Component.OverrideSettings("8.3.17-settings.xml"); Holodeck.CopyPModeToHolodeckA("8.3.17-pmode.xml"); Holodeck.PutMessageSinglePayloadToHolodeckA("8.3.16-pmode"); // Act AS4Component.Start(); // Assert IEnumerable <FileInfo> deliverables = await PollingService.PollUntilPresentAsync( AS4Component.FullInputPath, fs => fs.Any(f => f.Extension == ".xml")); var doc = new XmlDocument(); doc.LoadXml(File.ReadAllText(deliverables.First().FullName)); XmlElement locationElement = doc["DeliverMessage"]?["Payloads"]?["Payload"]?["Location"]; Assert.True(locationElement != null, "No payload location found in delivered DeliverMessage"); HttpResponseMessage downloadResponse = await PayloadServiceClient.GetAsync(locationElement.InnerText); Assert.Equal(HttpStatusCode.OK, downloadResponse.StatusCode); }
public void Test_8_3_18_AS4Message_Gets_Delivered_To_Http_Target() { // Before const string location = "http://localhost:4001/"; using (SpyHttpDeliverTarget deliverTarget = SpyHttpDeliverTarget.AtLocation(location)) { // Arrange Holodeck.CopyPModeToHolodeckA("8.3.18-pmode.xml"); Holodeck.PutMessageSinglePayloadToHolodeckA("8.3.17-pmode"); // Act AS4Component.Start(); // Assert Assert.True(deliverTarget.IsCalled, "Receive Single Payload Deliver HTTP Integration Test failed"); string deliverContent = deliverTarget.DeliveredMessage; Assert.False(String.IsNullOrEmpty(deliverContent), "Delivered Message was empty"); var doc = new XmlDocument(); doc.LoadXml(deliverContent); XmlNode deliverMessageNode = doc.SelectSingleNode("//*[local-name()='DeliverMessage']"); Assert.NotNull(deliverMessageNode); } }
public async Task Test_8_3_11_AS4Message_Gets_Responded_With_Non_Repudiation_Receipt() { // Arrange AS4Component.Start(); Holodeck.CopyPModeToHolodeckA("8.3.11-pmode.xml"); // Act Holodeck.PutMessageSinglePayloadToHolodeckA("8.3.11-pmode"); // Assert await PollingService.PollUntilPresentAsync(Holodeck.HolodeckALocations.InputPath); }
public async Task Test_8_3_14_AS4Message_Test_Message_Gets_Responded_But_Not_Delivered() { // Arrange AS4Component.Start(); Holodeck.CopyPModeToHolodeckA("8.3.14-pmode.xml"); // Act Holodeck.PutMessageSinglePayloadToHolodeckA("8.3.14-pmode"); // Assert await PollingService.PollUntilPresentAsync(Holodeck.HolodeckALocations.InputPath); Assert.Empty(Directory.GetFiles(AS4Component.FullInputPath, "*.xml")); }
public async Task Test_8_3_13_AS4Message_With_Single_Payload_Gets_Responded_With_Signed_NonRepudiation_Receipt() { // Arrange AS4Component.Start(); Holodeck.CopyPModeToHolodeckA("8.3.13-pmode.xml"); // Act Holodeck.PutMessageSinglePayloadToHolodeckA("8.3.13-pmode"); // Assert await PollingService.PollUntilPresentAsync( Holodeck.HolodeckALocations.InputPath, fs => fs.Any(f => f.Extension == ".xml"), timeout : TimeSpan.FromSeconds(50)); }
public async Task Test_8_4_1_Received_AS4Message_That_Cant_Be_Linked_To_ReceivingPMode_Result_In_Processing_Error() { // Arrange Holodeck.CopyPModeToHolodeckA("8.4.1-pmode.xml"); // Act Holodeck.PutMessageSinglePayloadToHolodeckA("8.4.1-pmode"); // Assert await PollingService.PollUntilPresentAsync( Holodeck.HolodeckALocations.InputPath, fs => fs.Any(f => f.Extension == ".xml")); Holodeck.AssertErrorOnHolodeckA(ErrorCode.Ebms0001); }
public async Task Test_8_3_1_AS4Message_With_Single_Payload_Result_In_File_Deliver() { // Arrange AS4Component.Start(); Holodeck.CopyPModeToHolodeckA("8.3.1-pmode.xml"); // Act Holodeck.PutMessageSinglePayloadToHolodeckA("8.3.1-pmode"); // Assert await PollingService.PollUntilPresentAsync( AS4Component.FullInputPath, fs => fs.Any(f => f.Extension == ".xml")); Holodeck.AssertSinglePayloadOnHolodeckA(); }
private async Task TestAS4MessageWithMultiplePayloadsUsingPModeAsync(string pmodeId) { // Arrange AS4Component.Start(); Holodeck.CopyPModeToHolodeckA($"{pmodeId}.xml"); // Act Holodeck.PutMessageTwoPayloadsToHolodeckA(pmodeId); // Assert await PollingService.PollUntilPresentAsync( AS4Component.FullInputPath, fs => fs.Count() == 3 && fs.Count(f => f.Extension == ".jpg") == 1 && fs.Count(f => f.Extension == ".xml") == 2); Holodeck.AssertSinglePayloadOnHolodeckA(); }