feat(deploy): RefreshDeploymentAsync send method
Add CommunicationService.RefreshDeploymentAsync — the typed send method for the small notify-and-fetch wire message (RefreshDeploymentCommand). Mirrors DeployInstanceAsync exactly: SiteEnvelope + Ask<DeploymentStatusResponse> bounded by DeploymentTimeout. CentralCommunicationActor needs no change (HandleSiteEnvelope is fully generic — all SiteEnvelope messages forward to /user/site-communication without a per-type switch). Adds a parallel routing test asserting the envelope reaches the site ClusterClient.
This commit is contained in:
@@ -101,6 +101,25 @@ public class CentralCommunicationActorTests : TestKit
|
||||
Assert.Equal("dep1", ((DeployInstanceCommand)msg.Message).DeploymentId);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ClusterClientRouting_RefreshDeploymentCommand_RoutesToSite()
|
||||
{
|
||||
var site = CreateSite("site1", "akka.tcp://scadabridge@host:8082");
|
||||
var (actor, _, siteProbes) = CreateActorWithMockRepo(new[] { site });
|
||||
|
||||
Thread.Sleep(1000);
|
||||
|
||||
var command = new RefreshDeploymentCommand(
|
||||
"dep1", "inst1", "rev1", "admin", DateTimeOffset.UtcNow,
|
||||
"https://central:9000", "tok1");
|
||||
actor.Tell(new SiteEnvelope("site1", command));
|
||||
|
||||
var msg = siteProbes["site1"].ExpectMsg<ClusterClient.Send>();
|
||||
Assert.Equal("/user/site-communication", msg.Path);
|
||||
Assert.IsType<RefreshDeploymentCommand>(msg.Message);
|
||||
Assert.Equal("dep1", ((RefreshDeploymentCommand)msg.Message).DeploymentId);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void UnconfiguredSite_MessageIsDropped()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user