-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Akka.Cluster.Tools.Client support (#66)
* Add Akka.Cluster.Tools.Client support * Add settings unit tests * Simplify ClusterClient setup * Add some WithClusterClient overloads to give user options
- Loading branch information
Showing
4 changed files
with
174 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System.Collections.Generic; | ||
using Akka.Actor; | ||
using Akka.Cluster.Tools.Client; | ||
using FluentAssertions; | ||
using FluentAssertions.Extensions; | ||
using Xunit; | ||
|
||
namespace Akka.Cluster.Hosting.Tests; | ||
|
||
public class ClusterClientSpecs | ||
{ | ||
[Fact(DisplayName = "ClusterClientReceptionistSettings should be set correctly")] | ||
public void ClusterClientReceptionistSettingsSpec() | ||
{ | ||
var config = AkkaClusterHostingExtensions.CreateReceptionistConfig("customName", "customRole") | ||
.GetConfig("akka.cluster.client.receptionist"); | ||
var settings = ClusterReceptionistSettings.Create(config); | ||
|
||
config.GetString("name").Should().Be("customName"); | ||
settings.Role.Should().Be("customRole"); | ||
} | ||
|
||
[Fact(DisplayName = "ClusterClientSettings should be set correctly")] | ||
public void ClusterClientSettingsSpec() | ||
{ | ||
var contacts = new List<ActorPath> | ||
{ | ||
ActorPath.Parse("akka.tcp://one@localhost:1111/system/receptionist"), | ||
ActorPath.Parse("akka.tcp://two@localhost:1111/system/receptionist"), | ||
ActorPath.Parse("akka.tcp://three@localhost:1111/system/receptionist"), | ||
}; | ||
|
||
var settings = AkkaClusterHostingExtensions.CreateClusterClientSettings( | ||
ClusterClientReceptionist.DefaultConfig(), | ||
contacts); | ||
|
||
settings.InitialContacts.Should().BeEquivalentTo(contacts); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
using System.Runtime.CompilerServices; | ||
|
||
[assembly: InternalsVisibleTo("Akka.Cluster.Hosting.Tests")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters