Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PORT #6167] Improve error/exception message for misconfigured cluste…
…r provider (#6169) * Improve error/exception message for misconfigured cluster provider (#6167) * Improve error/exception message for misconfigured cluster provider * Remove pattern matching * Improve validation to also catch other invalid configuration scenario * Simplify code * Update API Verify list (cherry picked from commit 5f8710d) * Update API Verify list
- Loading branch information
Showing
8 changed files
with
66 additions
and
9 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
src/contrib/cluster/Akka.Cluster.Sharding.Tests/InvalidSettingsSpec.cs
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,26 @@ | ||
// ----------------------------------------------------------------------- | ||
// <copyright file="InvalidSettingsSpec.cs" company="Akka.NET Project"> | ||
// Copyright (C) 2009-2022 Lightbend Inc. <http://www.lightbend.com> | ||
// Copyright (C) 2013-2022 .NET Foundation <https://github.com/akkadotnet/akka.net> | ||
// </copyright> | ||
// ----------------------------------------------------------------------- | ||
|
||
using Akka.Configuration; | ||
using Akka.TestKit; | ||
using FluentAssertions; | ||
using Xunit; | ||
using static FluentAssertions.FluentActions; | ||
|
||
namespace Akka.Cluster.Sharding.Tests | ||
{ | ||
public class InvalidSettingsSpec: AkkaSpec | ||
{ | ||
[Fact(DisplayName = "ClusterSharding started with invalid actor provider should raise a user friendly exception")] | ||
public void InvalidActorProviderTest() | ||
{ | ||
Invoking(() => ClusterSharding.Get(Sys)) // throws here | ||
.Should().ThrowExactly<ConfigurationException>() | ||
.WithMessage("*Did you forgot*"); | ||
} | ||
} | ||
} |
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
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
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,31 @@ | ||
// ----------------------------------------------------------------------- | ||
// <copyright file="InvalidClusterSettingsSpec.cs" company="Akka.NET Project"> | ||
// Copyright (C) 2009-2022 Lightbend Inc. <http://www.lightbend.com> | ||
// Copyright (C) 2013-2022 .NET Foundation <https://github.com/akkadotnet/akka.net> | ||
// </copyright> | ||
// ----------------------------------------------------------------------- | ||
|
||
using Akka.Configuration; | ||
using Akka.TestKit; | ||
using FluentAssertions; | ||
using Xunit; | ||
using Xunit.Abstractions; | ||
using static FluentAssertions.FluentActions; | ||
|
||
namespace Akka.Cluster.Tests | ||
{ | ||
public class InvalidClusterSettingsSpec : AkkaSpec | ||
{ | ||
public InvalidClusterSettingsSpec(ITestOutputHelper output) : base(output) | ||
{ | ||
} | ||
|
||
[Fact(DisplayName = "Cluster started with invalid actor provider should raise a user friendly exception")] | ||
public void InvalidActorProviderTest() | ||
{ | ||
Invoking(() => Cluster.Get(Sys)) // throws here | ||
.Should().ThrowExactly<ConfigurationException>() | ||
.WithMessage("*Did you forgot*"); | ||
} | ||
} | ||
} |
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