public void ControlReleaseSkippedWhenBatchIsDisabled() { // register the batch again so as to disable it BatchAdapter.RegisterBatch(_envelopeSpecName, null, false, 3); BatchAdapter.AddPart(_envelopeSpecName, null, ActivityId.NewActivityId(), "<data>some-value</data>"); BatchAdapter.CreateReleaseMessage(_envelopeSpecName, null).DropToFolder(DropFolders.INPUT_FOLDER, "release_batch.xml"); // batch controlled release process var process = TrackingRepository.SingleProcess( p => p.Name == Factory.Areas.Batch.Processes.Release && p.BeginTime > StartTime && p.Status == TrackingStatus.Completed); process.SingleMessagingStep( s => s.Name == BizTalkFactoryApplication.ReceiveLocation <UnitTestInputMessageReceiveLocation>().Name && s.MessageType == new SchemaMetadata <Schemas.Xml.Batch.Release>().MessageType && s.Status == TrackingStatus.Received && _envelopeSpecName.StartsWith(s.Value1)); process.SingleMessagingStep( s => s.Name == BizTalkFactoryApplication.SendPort <BatchQueueControlledReleaseSendPort>().Name && s.MessageType == new SchemaMetadata <Schemas.Xml.Batch.Release>().MessageType && s.Status == TrackingStatus.Sent && _envelopeSpecName.StartsWith(s.Value1)); Assert.That(BatchAdapter.QueuedControlledReleases.Count(), Is.EqualTo(0)); }
public void TrackBatchReleasedOnPollingWhenNoMessagingStepActivityIds() { BatchAdapter.AddPart(_envelopeSpecName, "partition-z", null, "<data>some-partitioned-value</data>"); BatchAdapter.AddPart(_envelopeSpecName, "partition-z", null, "<data>some-partitioned-value</data>"); BatchAdapter.AddPart(_envelopeSpecName, "partition-z", null, "<data>some-partitioned-value</data>"); BatchReleasePort.Enable(); // batch content handling process var process = TrackingRepository.SingleProcess( p => p.Name == Default.Processes.Unidentified && p.BeginTime > StartTime && p.Status == TrackingStatus.Completed && _envelopeSpecName.StartsWith(p.Value1) && p.Value3 == "partition-z"); var releaseProcessBatchMessagingStep = process.SingleMessagingStep( s => s.Name == BizTalkFactoryApplication.ReceiveLocation <BatchReceiveLocation>().Name // TODO && s.MessageType == new SchemaMetadata<BatchContent>().MessageType && s.Status == TrackingStatus.Received); process.SingleMessagingStep( s => s.Name == BizTalkFactoryApplication.SendPort <UnitTestBatchReleaseSendPort>().Name && s.Status == TrackingStatus.Sent && s.MessageType == new SchemaMetadata <Envelope>().MessageType && _envelopeSpecName.StartsWith(s.Value1) && s.Value3 == "partition-z"); // no batch release process has been created as no parts provide a MessagingStepActivityId that could be used to link a part to its batch Assert.That(releaseProcessBatchMessagingStep.Processes.Count(p => p.Name == Factory.Areas.Batch.Processes.Release && p.BeginTime > StartTime), Is.EqualTo(0)); }
public void AddPartToPartitionedBatch() { BatchAdapter.CreatePartMessage(_envelopeSpecName, "partition-z").DropToFolder(DropFolders.INPUT_FOLDER, "part.xml.part"); var process = TrackingRepository.SingleProcess( p => p.Name == Factory.Areas.Batch.Processes.Aggregate && p.BeginTime > StartTime && p.Value3 == "partition-z"); process.SingleMessagingStep( s => s.Name == BizTalkFactoryApplication.ReceiveLocation <UnitTestBatchAddPartReceiveLocation>().Name && s.MessageType == new SchemaMetadata <Any>().MessageType && s.Status == TrackingStatus.Received && _envelopeSpecName.StartsWith(s.Value1, StringComparison.Ordinal) && s.Value3 == "partition-z"); var addPartMessage = process.SingleMessagingStep( s => s.Name == BizTalkFactoryApplication.SendPort <BatchAddPartSendPort>().Name && s.MessageType == new SchemaMetadata <Any>().MessageType && s.Status == TrackingStatus.Sent && _envelopeSpecName.StartsWith(s.Value1, StringComparison.Ordinal) && s.Value3 == "partition-z"); var part = BatchAdapter.Parts.Single(); Assert.That(part.MessagingStepActivityId, Is.EqualTo(addPartMessage.ActivityID)); Assert.That(part.Partition, Is.EqualTo("partition-z")); }
public void ControlReleaseOneEnvelopeAndOnePartition() { BatchAdapter.AddPart(_envelopeSpecName, "partition-z", ActivityId.NewActivityId(), "<data>some-partitioned-value</data>"); BatchAdapter.CreateReleaseMessage(_envelopeSpecName, "partition-z").DropToFolder(DropFolders.INPUT_FOLDER, "release_batch.xml"); // batch controlled release process var process = TrackingRepository.SingleProcess( p => p.Name == Factory.Areas.Batch.Processes.Release && p.BeginTime > StartTime && p.Status == TrackingStatus.Completed && _envelopeSpecName.StartsWith(p.Value1) && p.Value3 == "partition-z"); process.SingleMessagingStep( s => s.Name == BizTalkFactoryApplication.ReceiveLocation <UnitTestInputMessageReceiveLocation>().Name && s.MessageType == new SchemaMetadata <Schemas.Xml.Batch.Release>().MessageType && s.Status == TrackingStatus.Received && _envelopeSpecName.StartsWith(s.Value1) && s.Value3 == "partition-z"); process.SingleMessagingStep( s => s.Name == BizTalkFactoryApplication.SendPort <BatchQueueControlledReleaseSendPort>().Name && s.MessageType == new SchemaMetadata <Schemas.Xml.Batch.Release>().MessageType && s.Status == TrackingStatus.Sent && _envelopeSpecName.StartsWith(s.Value1) && s.Value3 == "partition-z"); Assert.That(BatchAdapter.QueuedControlledReleases.Count(), Is.EqualTo(1)); BatchReleasePort.Enable(); // batch content handling process process = TrackingRepository.SingleProcess( p => p.Name == Default.Processes.Unidentified && p.BeginTime > StartTime && p.Status == TrackingStatus.Completed && _envelopeSpecName.StartsWith(p.Value1) && p.Value3 == "partition-z"); process.SingleMessagingStep( s => s.Name == BizTalkFactoryApplication.ReceiveLocation <BatchReceiveLocation>().Name // TODO && s.MessageType == new SchemaMetadata<BatchContent>().MessageType && s.Status == TrackingStatus.Received); var envelopeMessagingStep = process.SingleMessagingStep( s => s.Name == BizTalkFactoryApplication.SendPort <UnitTestBatchReleaseSendPort>().Name && s.Status == TrackingStatus.Sent && s.MessageType == new SchemaMetadata <Envelope>().MessageType && _envelopeSpecName.StartsWith(s.Value1) && s.Value3 == "partition-z"); Assert.That( envelopeMessagingStep.Message.Body, Is.EqualTo("<ns0:Envelope xmlns:ns0=\"urn:schemas.stateless.be:biztalk:envelope:2013:07\"><data>some-partitioned-value</data></ns0:Envelope>")); }
public void ControlReleaseOneEnvelopeAndAllPartitions() { BatchAdapter.AddPart(_envelopeSpecName, null, ActivityId.NewActivityId(), "<data>some-partitioned-value</data>"); BatchAdapter.AddPart(_envelopeSpecName, "p-one", ActivityId.NewActivityId(), "<data>some-partitioned-value</data>"); BatchAdapter.AddPart(_envelopeSpecName, "p-two", ActivityId.NewActivityId(), "<data>some-partitioned-value</data>"); BatchAdapter.AddPart(_envelopeSpecName, "p-six", ActivityId.NewActivityId(), "<data>some-partitioned-value</data>"); BatchAdapter.AddPart("e-one", null, ActivityId.NewActivityId(), "<data>some-partitioned-value</data>"); BatchAdapter.AddPart("e-one", "p-one", ActivityId.NewActivityId(), "<data>some-partitioned-value</data>"); BatchAdapter.AddPart("e-one", "p-two", ActivityId.NewActivityId(), "<data>some-partitioned-value</data>"); BatchAdapter.AddPart("e-one", "p-six", ActivityId.NewActivityId(), "<data>some-partitioned-value</data>"); BatchAdapter.CreateReleaseMessage(_envelopeSpecName, "*").DropToFolder(DropFolders.INPUT_FOLDER, "release_batch.xml"); // batch controlled release process var process = TrackingRepository.SingleProcess( p => p.Name == Factory.Areas.Batch.Processes.Release && p.BeginTime > StartTime && p.Status == TrackingStatus.Completed && p.Status == TrackingStatus.Completed && _envelopeSpecName.StartsWith(p.Value1) && p.Value3 == "*"); process.SingleMessagingStep( s => s.Name == BizTalkFactoryApplication.ReceiveLocation <UnitTestInputMessageReceiveLocation>().Name && s.MessageType == new SchemaMetadata <Schemas.Xml.Batch.Release>().MessageType && s.Status == TrackingStatus.Received && _envelopeSpecName.StartsWith(s.Value1) && s.Value3 == "*"); process.SingleMessagingStep( s => s.Name == BizTalkFactoryApplication.SendPort <BatchQueueControlledReleaseSendPort>().Name && s.MessageType == new SchemaMetadata <Schemas.Xml.Batch.Release>().MessageType && s.Status == TrackingStatus.Sent && _envelopeSpecName.StartsWith(s.Value1) && s.Value3 == "*"); var queuedControlledReleases = BatchAdapter.QueuedControlledReleases.ToArray(); Assert.That( queuedControlledReleases.Count(), Is.EqualTo(4)); Assert.That( queuedControlledReleases.Select(qcr => qcr.EnvelopeId).Distinct().Single(), Is.EqualTo(BatchAdapter.Envelopes.Single(e => e.SpecName == _envelopeSpecName).Id)); Assert.That( queuedControlledReleases.Select(qcr => qcr.Partition), Is.EquivalentTo(new[] { "0", "p-one", "p-two", "p-six" })); }
public void AllTokensAvailableForCheckOutAreReleased() { var tokenUrls = new[] { "payload-data-file-13", "payload-data-file-23", "payload-data-file-33" }; var correlationTokens = new[] { "correlation-token-13", "correlation-token-23", "correlation-token-33" }; tokenUrls.Each( (i, tu) => { InsertToken(tu, correlationTokens[i]); new StringStream("This payload has been claimed to disk.").DropToFolder(CheckOutFolder, tu); }); ReleaseTokensFromDatabase(tokenUrls); correlationTokens.Each( ct => { // Unidentified process because check-in phase has been skipped and no Claim.Check process name could have been inserted in context var process = TrackingRepository.SingleProcess(p => p.Name == Default.Processes.Unidentified && p.Value1 == ct && p.BeginTime > StartTime); process.SingleMessagingStep(s => s.Name == "BizTalk.Factory.RL1.Claim.CheckOut.WCF-SQL.XML" && s.Value1 == ct && s.Status == TrackingStatus.Received); process.SingleMessagingStep(s => s.Name == "BizTalk.Factory.SP1.UnitTest.Claim.Redeem.FILE.XML" && s.Value1 == ct && s.Status == TrackingStatus.Sent); }); }
public void CheckedOutTokenHasAnyExtraXmlContentRestored() { const string tokenUrl = "payload-data-file"; const string correlationToken = "correlation-token-2"; const string environmentTag = "environment-tag-2"; const string receiverName = "receiver-name-2"; const string senderName = "sender-name-2"; const string extraContent = "<extra-content>" + "<node>value</node>" + "<record><field1>value1</field1><field2>value2</field2><field3>value3</field3></record>" + "</extra-content>" + "<optional-content><node>value</node></optional-content>"; InsertToken(tokenUrl, correlationToken, environmentTag, "text-message-type-2", receiverName, senderName, extraContent); new StringStream("This payload has been claimed to disk.").DropToFolder(CheckOutFolder, tokenUrl); ReleaseTokenFromDatabase(tokenUrl); // Unidentified process because check-in phase has been skipped and no Claim.Check process name could have been inserted in context var process = TrackingRepository.SingleProcess( p => p.Name == Default.Processes.Unidentified && p.Value1 == correlationToken && p.Value2 == receiverName && p.Value3 == senderName && p.BeginTime > StartTime); var tokenMessagingStep = process.SingleMessagingStep( s => s.Name == BizTalkFactoryApplication.ReceiveLocation <ClaimReceiveLocation>().Name && s.Value1 == correlationToken && s.Value2 == receiverName && s.Value3 == senderName && s.Status == TrackingStatus.Received); process.SingleMessagingStep( s => s.Name == BizTalkFactoryApplication.SendPort <UnitTestClaimRedeemSendPort>().Name && s.Value1 == correlationToken && s.Value2 == receiverName && s.Value3 == senderName && s.Status == TrackingStatus.Sent); Assert.That(tokenMessagingStep.Message.Body, Does.EndWith("</clm:Url>" + extraContent + "</clm:CheckOut>")); }
public void ClaimBinaryMessage() { ResourceManager.Load("Data.Payload.bin").DropToFolder(DropFolders.INPUT_FOLDER, "Payload.bin.claim"); var process = TrackingRepository.SingleProcess( p => p.Name == Factory.Areas.Claim.Processes.Check && p.BeginTime > StartTime, TimeSpan.FromSeconds(60)); process.SingleMessagingStep( s => s.Name == BizTalkFactoryApplication.ReceiveLocation <UnitTestClaimDeskAnyReceiveLocation>().Name && s.Status == TrackingStatus.Received && s.MessageSize == ResourceManager.Load("Data.Payload.bin", stream => stream.Length)); process.SingleMessagingStep( s => s.Name == BizTalkFactoryApplication.SendPort <ClaimCheckInSendPort>().Name && s.MessageType == new SchemaMetadata <Schemas.Xml.Claim.CheckIn>().MessageType && s.Status == TrackingStatus.Sent); var token = FindTokens().Single(); Assert.That(File.Exists(Path.Combine(CheckInFolder, token.Url.Replace("\\", string.Empty) + ".chk"))); }
public void PollForAvailableBatchesToRelease() { // create three-item partitioned batches, so as to trigger an automatic release via polling receive-location BatchAdapter.AddPart(_envelopeSpecName, "one", ActivityId.NewActivityId(), "<data>some-one-partitioned-value</data>"); BatchAdapter.AddPart(_envelopeSpecName, "one", ActivityId.NewActivityId(), "<data>some-one-partitioned-value</data>"); BatchAdapter.AddPart(_envelopeSpecName, "one", ActivityId.NewActivityId(), "<data>some-one-partitioned-value</data>"); BatchAdapter.AddPart(_envelopeSpecName, "two", ActivityId.NewActivityId(), "<data>some-two-partitioned-value</data>"); BatchAdapter.AddPart(_envelopeSpecName, "two", ActivityId.NewActivityId(), "<data>some-two-partitioned-value</data>"); BatchAdapter.AddPart(_envelopeSpecName, "two", ActivityId.NewActivityId(), "<data>some-two-partitioned-value</data>"); BatchAdapter.AddPart(_envelopeSpecName, "six", ActivityId.NewActivityId(), "<data>some-six-partitioned-value</data>"); BatchAdapter.AddPart(_envelopeSpecName, "six", ActivityId.NewActivityId(), "<data>some-six-partitioned-value</data>"); BatchAdapter.AddPart(_envelopeSpecName, "six", ActivityId.NewActivityId(), "<data>some-six-partitioned-value</data>"); BatchReleasePort.Enable(); // batch content handling processes TrackingRepository.SingleProcess( p => p.Name == Default.Processes.Unidentified && p.BeginTime > StartTime && p.Status == TrackingStatus.Completed && _envelopeSpecName.StartsWith(p.Value1) && p.Value3 == "one"); TrackingRepository.SingleProcess( p => p.Name == Default.Processes.Unidentified && p.BeginTime > StartTime && p.Status == TrackingStatus.Completed && _envelopeSpecName.StartsWith(p.Value1) && p.Value3 == "two"); TrackingRepository.SingleProcess( p => p.Name == Default.Processes.Unidentified && p.BeginTime > StartTime && p.Status == TrackingStatus.Completed && _envelopeSpecName.StartsWith(p.Value1) && p.Value3 == "six"); }
public void TrackBatchReleasedOnPolling() { BatchAdapter.CreatePartMessage(_envelopeSpecName, "partition-z").DropToFolder(DropFolders.INPUT_FOLDER, "part.xml.part"); var process = TrackingRepository.SingleProcess( p => p.Name == Factory.Areas.Batch.Processes.Aggregate && p.BeginTime > StartTime); var addPartMessage1 = process.SingleMessagingStep( s => s.Name == BizTalkFactoryApplication.SendPort <BatchAddPartSendPort>().Name && s.MessageType == new SchemaMetadata <Any>().MessageType && s.Status == TrackingStatus.Sent && _envelopeSpecName.StartsWith(s.Value1) && s.Value3 == "partition-z"); BatchAdapter.CreatePartMessage(_envelopeSpecName, "partition-z").DropToFolder(DropFolders.INPUT_FOLDER, "part.xml.part"); process = TrackingRepository.SingleProcess( p => p.Name == Factory.Areas.Batch.Processes.Aggregate // ReSharper disable once AccessToModifiedClosure && p.BeginTime > process.EndTime); var addPartMessage2 = process.SingleMessagingStep( s => s.Name == BizTalkFactoryApplication.SendPort <BatchAddPartSendPort>().Name && s.MessageType == new SchemaMetadata <Any>().MessageType && s.Status == TrackingStatus.Sent && _envelopeSpecName.StartsWith(s.Value1) && s.Value3 == "partition-z"); BatchAdapter.CreatePartMessage(_envelopeSpecName, "partition-z").DropToFolder(DropFolders.INPUT_FOLDER, "part.xml.part"); process = TrackingRepository.SingleProcess( p => p.Name == Factory.Areas.Batch.Processes.Aggregate // ReSharper disable once AccessToModifiedClosure && p.BeginTime > process.EndTime); var addPartMessage3 = process.SingleMessagingStep( s => s.Name == BizTalkFactoryApplication.SendPort <BatchAddPartSendPort>().Name && s.MessageType == new SchemaMetadata <Any>().MessageType && s.Status == TrackingStatus.Sent && _envelopeSpecName.StartsWith(s.Value1) && s.Value3 == "partition-z"); BatchReleasePort.Enable(); // batch controlled release process process = TrackingRepository.SingleProcess( p => p.Name == Factory.Areas.Batch.Processes.Release && p.BeginTime > StartTime && p.Status == TrackingStatus.Completed); // 1st part process.SingleMessagingStep(s => s.ActivityID == addPartMessage1.ActivityID); // 2nd part process.SingleMessagingStep(s => s.ActivityID == addPartMessage2.ActivityID); // 3rd part process.SingleMessagingStep(s => s.ActivityID == addPartMessage3.ActivityID); // batch content var releaseProcessBatchMessagingStep = process.SingleMessagingStep( s => s.Name == BizTalkFactoryApplication.ReceiveLocation <BatchReceiveLocation>().Name // TODO && s.MessageType == new SchemaMetadata<BatchContent>().MessageType && s.Status == TrackingStatus.Received); // batch content handling process process = TrackingRepository.SingleProcess( p => p.Name == Default.Processes.Unidentified && p.BeginTime > StartTime && p.Status == TrackingStatus.Completed && _envelopeSpecName.StartsWith(p.Value1) && p.Value3 == "partition-z"); var handlingProcessBatchMessagingStep = process.SingleMessagingStep( s => s.Name == BizTalkFactoryApplication.ReceiveLocation <BatchReceiveLocation>().Name // TODO && s.MessageType == new SchemaMetadata<BatchContent>().MessageType && s.Status == TrackingStatus.Received); Assert.That(releaseProcessBatchMessagingStep.ActivityID, Is.EqualTo(handlingProcessBatchMessagingStep.ActivityID)); // a part is linked to both its aggregate and release processes Assert.That(addPartMessage1.Processes.Count(), Is.EqualTo(2)); Assert.That(addPartMessage1.Processes.SingleOrDefault(p => p.Name == Factory.Areas.Batch.Processes.Aggregate), Is.Not.Null); Assert.That(addPartMessage1.Processes.SingleOrDefault(p => p.Name == Factory.Areas.Batch.Processes.Release), Is.Not.Null); // a batch is linked to both its release and handling processes Assert.That(releaseProcessBatchMessagingStep.Processes.Count(), Is.EqualTo(2)); Assert.That(releaseProcessBatchMessagingStep.Processes.SingleOrDefault(p => p.Name == Factory.Areas.Batch.Processes.Release), Is.Not.Null); Assert.That(releaseProcessBatchMessagingStep.Processes.SingleOrDefault(p => p.Name == Default.Processes.Unidentified), Is.Not.Null); }
public void ClaimXmlMessage() { new FakeClaimStream().DropToFolder(DropFolders.INPUT_FOLDER, "large_message.xml.claim"); var process = TrackingRepository.SingleProcess( p => p.Name == Factory.Areas.Claim.Processes.Check && p.BeginTime > StartTime && p.Value1 == "embedded-correlation-token" && p.Value2 == "embedded-receiver-name" && p.Value3 == "embedded-sender-name", TimeSpan.FromSeconds(60)); // message check-in phase var inboundMessagingStep = process.SingleMessagingStep( s => s.Name == BizTalkFactoryApplication.ReceiveLocation <UnitTestClaimDeskXmlReceiveLocation>().Name && s.MessageType == new SchemaMetadata <Schemas.Xml.Claim.CheckIn>().MessageType && s.Status == TrackingStatus.Received && s.Value1 == "embedded-correlation-token" && s.Value2 == "embedded-receiver-name" && s.Value3 == "embedded-sender-name"); var tokenMessagingStep = process.SingleMessagingStep( s => s.Name == BizTalkFactoryApplication.SendPort <ClaimCheckInSendPort>().Name && s.MessageType == new SchemaMetadata <Schemas.Xml.Claim.CheckIn>().MessageType && s.Status == TrackingStatus.Sent && s.Value1 == "embedded-correlation-token" && s.Value2 == "embedded-receiver-name" && s.Value3 == "embedded-sender-name"); // claim-specific context properties are captured Assert.That(tokenMessagingStep.Context.GetProperty(BizTalkFactoryProperties.CorrelationToken).Value, Is.EqualTo("embedded-correlation-token")); Assert.That(tokenMessagingStep.Context.GetProperty(BizTalkFactoryProperties.EnvironmentTag).Value, Is.EqualTo("embedded-environment-tag")); Assert.That(tokenMessagingStep.Context.GetProperty(BizTalkFactoryProperties.ReceiverName).Value, Is.EqualTo("embedded-receiver-name")); Assert.That(tokenMessagingStep.Context.GetProperty(BizTalkFactoryProperties.SenderName).Value, Is.EqualTo("embedded-sender-name")); // payload has been claimed into claim store var token = FindTokens().Single(); Assert.That(token.MessageType, Is.EqualTo(new SchemaMetadata <Any>().MessageType)); using (var reader = XmlReader.Create(tokenMessagingStep.Message.Stream)) { var url = reader.AsMessageBodyCaptureDescriptor().Data; Assert.That(token.Url, Is.EqualTo(url)); } Assert.That(File.Exists(token.FilePath)); // move the claimed payload from the check-in folder to the check-out one as the ClaimStoreAgent would do ReleaseToken(token); // message check-out phase tokenMessagingStep = process.SingleMessagingStep( s => s.Name == BizTalkFactoryApplication.ReceiveLocation <ClaimReceiveLocation>().Name && s.MessageType == new SchemaMetadata <Schemas.Xml.Claim.CheckOut>().MessageType && s.Status == TrackingStatus.Received && s.Value1 == "embedded-correlation-token" && s.Value2 == "embedded-receiver-name" && s.Value3 == "embedded-sender-name"); var outboundMessagingStep = process.SingleMessagingStep( s => s.Name == BizTalkFactoryApplication.SendPort <UnitTestClaimRedeemSendPort>().Name && s.MessageType == new SchemaMetadata <Schemas.Xml.Claim.CheckOut>().MessageType && s.Status == TrackingStatus.Sent && s.Value1 == "embedded-correlation-token" && s.Value2 == "embedded-receiver-name" && s.Value3 == "embedded-sender-name"); // claim-specific context properties are restored and promoted Assert.That( tokenMessagingStep.Context.GetProperty(BizTalkFactoryProperties.ClaimedMessageType), Has.Property("Value").EqualTo(new SchemaMetadata <Any>().MessageType).And.Property("IsPromoted").True); Assert.That( tokenMessagingStep.Context.GetProperty(BizTalkFactoryProperties.CorrelationToken), Has.Property("Value").EqualTo("embedded-correlation-token").And.Property("IsPromoted").True); Assert.That( tokenMessagingStep.Context.GetProperty(BizTalkFactoryProperties.EnvironmentTag), Has.Property("Value").EqualTo("embedded-environment-tag").And.Property("IsPromoted").True); Assert.That( tokenMessagingStep.Context.GetProperty(BizTalkFactoryProperties.ReceiverName), Has.Property("Value").EqualTo("embedded-receiver-name").And.Property("IsPromoted").True); Assert.That( tokenMessagingStep.Context.GetProperty(BizTalkFactoryProperties.SenderName), Has.Property("Value").EqualTo("embedded-sender-name").And.Property("IsPromoted").True); // original inbound message payload has been restored Assert.That(inboundMessagingStep.Message.Body, Is.EqualTo(outboundMessagingStep.Message.Body)); }