Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: Remove obsolete extension methods #466

Merged
merged 1 commit into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/NuGet.targets
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
<PackageReleaseNotes>
v5.0.0
- Add Pact Specification v4 support
- BREAKING CHANGE - Refactor verifier to support verifying combined HTTP and message pacts
- BREAKING CHANGE: Remove obsolete WithNativeBackend calls
- BREAKING CHANGE: Refactor verifier to support verifying combined HTTP and message pacts
</PackageReleaseNotes>
</PropertyGroup>
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
Expand Down
44 changes: 0 additions & 44 deletions src/PactNet/PactExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,6 @@ public static class PactExtensions
private static readonly object LogLocker = new object();
private static bool LogInitialised = false;

/// <summary>
/// Establish a new pact using the native backend
/// </summary>
/// <param name="pact">Pact details</param>
/// <param name="port">Port for the mock server. If null, one will be assigned automatically</param>
/// <param name="host">Host for the mock server</param>
/// <returns>Pact builder</returns>
/// <remarks>
/// If multiple mock servers are started at the same time, you must make sure you don't supply the same port twice.
/// It is advised that the port is not specified whenever possible to allow PactNet to allocate a port dynamically
/// and ensure there are no port clashes
/// </remarks>
[Obsolete("Use WithHttpInteractions instead. Will be removed in PactNet 5.0.0")]
public static IPactBuilderV2 UsingNativeBackend(this IPactV2 pact, int? port = null, IPAddress host = IPAddress.Loopback)
=> pact.WithHttpInteractions(port, host);

/// <summary>
/// Establish a new pact using the native backend
/// </summary>
/// <param name="pact">Pact details</param>
/// <param name="port">Port for the mock server. If null, one will be assigned automatically</param>
/// <param name="host">Host for the mock server</param>
/// <returns>Pact builder</returns>
/// <remarks>
/// If multiple mock servers are started at the same time, you must make sure you don't supply the same port twice.
/// It is advised that the port is not specified whenever possible to allow PactNet to allocate a port dynamically
/// and ensure there are no port clashes
/// </remarks>
[Obsolete("Use WithHttpInteractions instead. Will be removed in PactNet 5.0.0")]
public static IPactBuilderV3 UsingNativeBackend(this IPactV3 pact, int? port = null, IPAddress host = IPAddress.Loopback)
=> pact.WithHttpInteractions(port, host);

/// <summary>
/// Establish a new pact using the native backend
/// </summary>
Expand Down Expand Up @@ -114,18 +82,6 @@ public static IPactBuilderV4 WithHttpInteractions(this IPactV4 pact, int? port =
return builder;
}

/// <summary>
/// Establish a new message pact using the native backend
/// </summary>
/// <param name="messagePact">Message Pact details</param>
/// <returns>Pact builder</returns>
[Obsolete("Use WithMessageInteractions instead. Will be removed in PactNet 5.0.0")]
public static IMessagePactBuilderV3 UsingNativeBackend(this IMessagePactV3 messagePact)
{
var pact = Pact.V3(messagePact.Consumer, messagePact.Provider, messagePact.Config);
return pact.WithMessageInteractions();
}

/// <summary>
/// Add asynchronous message (i.e. consumer/producer) interactions to the pact
/// </summary>
Expand Down