diff --git a/src/EventStore.Client.PersistentSubscriptions/EventStorePersistentSubscriptionsClient.Read.cs b/src/EventStore.Client.PersistentSubscriptions/EventStorePersistentSubscriptionsClient.Read.cs index d149973d5..211ffdbeb 100644 --- a/src/EventStore.Client.PersistentSubscriptions/EventStorePersistentSubscriptionsClient.Read.cs +++ b/src/EventStore.Client.PersistentSubscriptions/EventStorePersistentSubscriptionsClient.Read.cs @@ -24,19 +24,20 @@ public async Task SubscribeAsync( ) { if (autoAck) { throw new InvalidOperationException( - $"AutoAck is no longer supported. Please use {nameof(SubscribeToStreamAsync)} with manual acks instead." + $"AutoAck is no longer supported. Please use {nameof(SubscribeToStream)} with manual acks instead." ); } - return await SubscribeToStreamAsync( - streamName, - groupName, - eventAppeared, - subscriptionDropped, - userCredentials, - bufferSize, - cancellationToken - ).ConfigureAwait(false); + return await PersistentSubscription + .Confirm( + SubscribeToStream(streamName, groupName, bufferSize, userCredentials, cancellationToken), + eventAppeared, + subscriptionDropped ?? delegate { }, + _log, + userCredentials, + cancellationToken + ) + .ConfigureAwait(false); } /// @@ -45,7 +46,6 @@ public async Task SubscribeAsync( /// /// /// - [Obsolete("SubscribeToStreamAsync is no longer supported. Use SubscribeToStream with manual acks instead.", false)] public async Task SubscribeToStreamAsync( string streamName, string groupName, Func eventAppeared, @@ -135,7 +135,6 @@ public PersistentSubscriptionResult SubscribeToStream( /// /// Subscribes to a persistent subscription to $all. Messages must be manually acknowledged /// - [Obsolete("SubscribeToAllAsync is no longer supported. Use SubscribeToAll with manual acks instead.", false)] public async Task SubscribeToAllAsync( string groupName, Func eventAppeared, diff --git a/src/EventStore.Client.PersistentSubscriptions/PersistentSubscription.cs b/src/EventStore.Client.PersistentSubscriptions/PersistentSubscription.cs index 1e79b9363..f3d19b42e 100644 --- a/src/EventStore.Client.PersistentSubscriptions/PersistentSubscription.cs +++ b/src/EventStore.Client.PersistentSubscriptions/PersistentSubscription.cs @@ -6,7 +6,6 @@ namespace EventStore.Client { /// /// Represents a persistent subscription connection. /// - [Obsolete] public class PersistentSubscription : IDisposable { private readonly EventStorePersistentSubscriptionsClient.PersistentSubscriptionResult _persistentSubscriptionResult; private readonly IAsyncEnumerator _enumerator; diff --git a/src/EventStore.Client.Streams/EventStoreClient.Subscriptions.cs b/src/EventStore.Client.Streams/EventStoreClient.Subscriptions.cs index 87497e7ce..6f3b2f2c6 100644 --- a/src/EventStore.Client.Streams/EventStoreClient.Subscriptions.cs +++ b/src/EventStore.Client.Streams/EventStoreClient.Subscriptions.cs @@ -18,7 +18,6 @@ public partial class EventStoreClient { /// The optional user credentials to perform operation with. /// The optional . /// - [Obsolete("SubscribeToAllAsync is no longer supported. Use SubscribeToAll instead.", false)] public Task SubscribeToAllAsync( FromAll start, Func eventAppeared, @@ -79,7 +78,6 @@ public StreamSubscriptionResult SubscribeToAll( /// The optional user credentials to perform operation with. /// The optional . /// - [Obsolete("SubscribeToStreamAsync is no longer supported. Use SubscribeToStream instead.", false)] public Task SubscribeToStreamAsync( string streamName, FromStream start, diff --git a/src/EventStore.Client.Streams/StreamSubscription.cs b/src/EventStore.Client.Streams/StreamSubscription.cs index c6b9e8ae6..f70080c17 100644 --- a/src/EventStore.Client.Streams/StreamSubscription.cs +++ b/src/EventStore.Client.Streams/StreamSubscription.cs @@ -5,7 +5,6 @@ namespace EventStore.Client { /// /// A class representing a . /// - [Obsolete] public class StreamSubscription : IDisposable { private readonly EventStoreClient.StreamSubscriptionResult _subscription; private readonly IAsyncEnumerator _messages; diff --git a/src/EventStore.Client.Streams/SubscriptionFilterOptions.cs b/src/EventStore.Client.Streams/SubscriptionFilterOptions.cs index 38469d924..b6eb22dd0 100644 --- a/src/EventStore.Client.Streams/SubscriptionFilterOptions.cs +++ b/src/EventStore.Client.Streams/SubscriptionFilterOptions.cs @@ -17,7 +17,6 @@ public class SubscriptionFilterOptions { /// A Task invoked and await when a checkpoint is reached. /// Set the checkpointInterval to define how often this method is called. /// - [Obsolete] public Func CheckpointReached { get; } = null!; /// @@ -30,7 +29,6 @@ public class SubscriptionFilterOptions { /// Set the checkpointInterval to define how often this method is called. /// /// - [Obsolete] public SubscriptionFilterOptions(IEventFilter filter, uint checkpointInterval, Func? checkpointReached) : this(filter, checkpointInterval) { diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_existing_with_max_one_client_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_existing_with_max_one_client_obsolete.cs similarity index 90% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_existing_with_max_one_client_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_existing_with_max_one_client_obsolete.cs index 200e12bb3..3c39e3598 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_existing_with_max_one_client_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_existing_with_max_one_client_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class connect_to_existing_with_max_one_client_obsolete : IClassFixture { const string Group = "maxoneclient"; diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_existing_with_permissions_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_existing_with_permissions_obsolete.cs similarity index 89% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_existing_with_permissions_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_existing_with_permissions_obsolete.cs index 719dc8b02..890dacf49 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_existing_with_permissions_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_existing_with_permissions_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class connect_to_existing_with_permissions_obsolete : IClassFixture { const string Group = "connectwithpermissions"; diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_existing_with_start_from_beginning_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_existing_with_start_from_beginning_obsolete.cs similarity index 94% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_existing_with_start_from_beginning_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_existing_with_start_from_beginning_obsolete.cs index 331930474..10b06a965 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_existing_with_start_from_beginning_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_existing_with_start_from_beginning_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class connect_to_existing_with_start_from_beginning_obsolete : IClassFixture { const string Group = "startfrombeginning"; diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_existing_with_start_from_not_set_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_existing_with_start_from_not_set_obsolete.cs similarity index 93% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_existing_with_start_from_not_set_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_existing_with_start_from_not_set_obsolete.cs index 2dce2c8dd..5446e1eef 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_existing_with_start_from_not_set_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_existing_with_start_from_not_set_obsolete.cs @@ -1,7 +1,7 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class connect_to_existing_with_start_from_not_set_obsolete : IClassFixture { const string Group = "startfromend1"; readonly Fixture _fixture; diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_existing_with_start_from_not_set_then_event_written_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_existing_with_start_from_not_set_then_event_written_obsolete.cs similarity index 94% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_existing_with_start_from_not_set_then_event_written_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_existing_with_start_from_not_set_then_event_written_obsolete.cs index 95dc8edf6..1ee2b6fae 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_existing_with_start_from_not_set_then_event_written_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_existing_with_start_from_not_set_then_event_written_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class connect_to_existing_with_start_from_not_set_then_event_written_obsolete : IClassFixture { const string Group = "startfromnotset2"; diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_existing_with_start_from_set_to_end_position_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_existing_with_start_from_set_to_end_position_obsolete.cs similarity index 93% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_existing_with_start_from_set_to_end_position_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_existing_with_start_from_set_to_end_position_obsolete.cs index 5b82b063d..7057b1489 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_existing_with_start_from_set_to_end_position_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_existing_with_start_from_set_to_end_position_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class connect_to_existing_with_start_from_set_to_end_position_obsolete: IClassFixture { const string Group = "startfromend1"; diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_existing_with_start_from_set_to_end_position_then_event_written_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_existing_with_start_from_set_to_end_position_then_event_written_obsolete.cs similarity index 95% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_existing_with_start_from_set_to_end_position_then_event_written_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_existing_with_start_from_set_to_end_position_then_event_written_obsolete.cs index 4f9dea90e..7083cb78f 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_existing_with_start_from_set_to_end_position_then_event_written_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_existing_with_start_from_set_to_end_position_then_event_written_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class connect_to_existing_with_start_from_set_to_end_position_then_event_written_obsolete : IClassFixture { diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_existing_with_start_from_set_to_invalid_middle_position_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_existing_with_start_from_set_to_invalid_middle_position_obsolete.cs similarity index 92% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_existing_with_start_from_set_to_invalid_middle_position_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_existing_with_start_from_set_to_invalid_middle_position_obsolete.cs index 639164294..f1d317b76 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_existing_with_start_from_set_to_invalid_middle_position_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_existing_with_start_from_set_to_invalid_middle_position_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class connect_to_existing_with_start_from_set_to_invalid_middle_position_obsolete : IClassFixture { const string Group = "startfrominvalid1"; diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_existing_with_start_from_set_to_valid_middle_position_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_existing_with_start_from_set_to_valid_middle_position_obsolete.cs similarity index 94% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_existing_with_start_from_set_to_valid_middle_position_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_existing_with_start_from_set_to_valid_middle_position_obsolete.cs index 7fc7b07c8..69230d695 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_existing_with_start_from_set_to_valid_middle_position_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_existing_with_start_from_set_to_valid_middle_position_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class connect_to_existing_with_start_from_set_to_valid_middle_position_obsolete : IClassFixture { const string Group = "startfromvalid"; diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_existing_without_permissions_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_existing_without_permissions_obsolete.cs similarity index 87% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_existing_without_permissions_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_existing_without_permissions_obsolete.cs index 82ee362b8..b09dbc46a 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_existing_without_permissions_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_existing_without_permissions_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class connect_to_existing_without_permissions_obsolete : IClassFixture { readonly Fixture _fixture; diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_existing_without_read_all_permissions_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_existing_without_read_all_permissions_obsolete.cs similarity index 88% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_existing_without_read_all_permissions_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_existing_without_read_all_permissions_obsolete.cs index 0ffe8daf4..da6f19f72 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_existing_without_read_all_permissions_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_existing_without_read_all_permissions_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class connect_to_existing_without_read_all_permissions_obsolete : IClassFixture { readonly Fixture _fixture; diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_non_existing_with_permissions_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_non_existing_with_permissions_obsolete.cs similarity index 88% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_non_existing_with_permissions_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_non_existing_with_permissions_obsolete.cs index 06f9a6d68..5f8c885c1 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_to_non_existing_with_permissions_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_to_non_existing_with_permissions_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class connect_to_non_existing_with_permissions_obsolete : IClassFixture { const string Group = "foo"; diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_with_retries_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_with_retries_obsolete.cs similarity index 92% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_with_retries_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_with_retries_obsolete.cs index 0eff7957e..085eecc3e 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/connect_with_retries_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/connect_with_retries_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class connect_with_retries_obsolete : IClassFixture { const string Group = "retries"; diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/deleting_existing_with_subscriber_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/deleting_existing_with_subscriber_obsolete.cs similarity index 94% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/deleting_existing_with_subscriber_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/deleting_existing_with_subscriber_obsolete.cs index 556224f23..fdca510d5 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/deleting_existing_with_subscriber_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/deleting_existing_with_subscriber_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class deleting_existing_with_subscriber_obsolete : IClassFixture { readonly Fixture _fixture; diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/get_info_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/get_info_obsolete.cs similarity index 98% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/get_info_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/get_info_obsolete.cs index d000304bb..6f42531fa 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/get_info_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/get_info_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class get_info_obsolete : IClassFixture { const string GroupName = nameof(get_info_obsolete); diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/happy_case_catching_up_to_link_to_events_manual_ack_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/happy_case_catching_up_to_link_to_events_manual_ack_obsolete.cs similarity index 94% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/happy_case_catching_up_to_link_to_events_manual_ack_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/happy_case_catching_up_to_link_to_events_manual_ack_obsolete.cs index b56ea25a9..cfccd2de2 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/happy_case_catching_up_to_link_to_events_manual_ack_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/happy_case_catching_up_to_link_to_events_manual_ack_obsolete.cs @@ -1,8 +1,8 @@ using System.Text; -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class happy_case_catching_up_to_link_to_events_manual_ack_obsolete : IClassFixture { const string Group = nameof(Group); diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/happy_case_catching_up_to_normal_events_manual_ack_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/happy_case_catching_up_to_normal_events_manual_ack_obsolete.cs similarity index 93% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/happy_case_catching_up_to_normal_events_manual_ack_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/happy_case_catching_up_to_normal_events_manual_ack_obsolete.cs index 6431b9514..cd1f69ee4 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/happy_case_catching_up_to_normal_events_manual_ack_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/happy_case_catching_up_to_normal_events_manual_ack_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class happy_case_catching_up_to_normal_events_manual_ack_obsolete : IClassFixture { const string Group = nameof(Group); const int BufferCount = 10; diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/happy_case_filtered_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/happy_case_filtered_obsolete.cs similarity index 94% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/happy_case_filtered_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/happy_case_filtered_obsolete.cs index aba17050d..f9169733b 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/happy_case_filtered_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/happy_case_filtered_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class happy_case_filtered_obsolete : IClassFixture { readonly Fixture _fixture; diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/happy_case_filtered_with_start_from_set_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/happy_case_filtered_with_start_from_set_obsolete.cs similarity index 95% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/happy_case_filtered_with_start_from_set_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/happy_case_filtered_with_start_from_set_obsolete.cs index bf8b140a4..111ca4e19 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/happy_case_filtered_with_start_from_set_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/happy_case_filtered_with_start_from_set_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class happy_case_filtered_with_start_from_set_obsolete : IClassFixture { readonly Fixture _fixture; diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/happy_case_writing_and_subscribing_to_normal_events_manual_ack_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/happy_case_writing_and_subscribing_to_normal_events_manual_ack_obsolete.cs similarity index 94% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/happy_case_writing_and_subscribing_to_normal_events_manual_ack_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/happy_case_writing_and_subscribing_to_normal_events_manual_ack_obsolete.cs index 42b5a7325..2563c488d 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/happy_case_writing_and_subscribing_to_normal_events_manual_ack_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/happy_case_writing_and_subscribing_to_normal_events_manual_ack_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class happy_case_writing_and_subscribing_to_normal_events_manual_ack_obsolete : IClassFixture { const string Group = nameof(Group); diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/update_existing_with_check_point_filtered_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/update_existing_with_check_point_filtered_obsolete.cs similarity index 96% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/update_existing_with_check_point_filtered_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/update_existing_with_check_point_filtered_obsolete.cs index ddb7445f6..0e9e2be21 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/update_existing_with_check_point_filtered_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/update_existing_with_check_point_filtered_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class update_existing_with_check_point_filtered_obsolete : IClassFixture { const string Group = "existing-with-check-point-filtered"; diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/update_existing_with_subscribers_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/update_existing_with_subscribers_obsolete.cs similarity index 93% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/update_existing_with_subscribers_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/update_existing_with_subscribers_obsolete.cs index 0be68cf78..17a77063c 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/update_existing_with_subscribers_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/update_existing_with_subscribers_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class update_existing_with_subscribers_obsolete : IClassFixture { const string Group = "existing"; diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/when_writing_and_filtering_out_events_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/when_writing_and_filtering_out_events_obsolete.cs similarity index 96% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/when_writing_and_filtering_out_events_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/when_writing_and_filtering_out_events_obsolete.cs index 4e1018ffe..302ac221a 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/when_writing_and_filtering_out_events_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/when_writing_and_filtering_out_events_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class when_writing_and_filtering_out_events_obsolete : IClassFixture { const string Group = "filtering-out-events"; diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/when_writing_and_subscribing_to_normal_events_manual_nack_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/when_writing_and_subscribing_to_normal_events_manual_nack_obsolete.cs similarity index 94% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/when_writing_and_subscribing_to_normal_events_manual_nack_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/when_writing_and_subscribing_to_normal_events_manual_nack_obsolete.cs index c1ff885a3..f18d6ad96 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/when_writing_and_subscribing_to_normal_events_manual_nack_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/Obsolete/when_writing_and_subscribing_to_normal_events_manual_nack_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class when_writing_and_subscribing_to_normal_events_manual_nack_obsolete : IClassFixture { const string Group = nameof(Group); diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/update_existing_filtered_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/update_existing_filtered_obsolete.cs deleted file mode 100644 index 67b13a197..000000000 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToAll/update_existing_filtered_obsolete.cs +++ /dev/null @@ -1,30 +0,0 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToAll; - -public class update_existing_filtered_obsolete - : IClassFixture { - const string Group = "existing-filtered"; - - readonly Fixture _fixture; - - public update_existing_filtered_obsolete(Fixture fixture) => _fixture = fixture; - - [SupportsPSToAll.Fact] - public async Task the_completion_succeeds() => - await _fixture.Client.UpdateToAllAsync( - Group, - new(true), - userCredentials: TestCredentials.Root - ); - - public class Fixture : EventStoreClientFixture { - protected override async Task Given() => - await Client.CreateToAllAsync( - Group, - EventTypeFilter.Prefix("prefix-filter-"), - new(), - userCredentials: TestCredentials.Root - ); - - protected override Task When() => Task.CompletedTask; - } -} diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_max_one_client_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_max_one_client_obsolete.cs similarity index 91% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_max_one_client_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_max_one_client_obsolete.cs index 94dce7f5a..8f290088c 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_max_one_client_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_max_one_client_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class connect_to_existing_with_max_one_client_obsolete : IClassFixture { const string Group = "startinbeginning1"; diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_permissions_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_permissions_obsolete.cs similarity index 90% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_permissions_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_permissions_obsolete.cs index 423c48303..70ada6f17 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_permissions_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_permissions_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class connect_to_existing_with_permissions_obsolete : IClassFixture { const string Stream = nameof(connect_to_existing_with_permissions_obsolete); diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_start_from_beginning_and_events_in_it_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_start_from_beginning_and_events_in_it_obsolete.cs similarity index 94% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_start_from_beginning_and_events_in_it_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_start_from_beginning_and_events_in_it_obsolete.cs index 9f9ced172..c023db1f8 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_start_from_beginning_and_events_in_it_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_start_from_beginning_and_events_in_it_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class connect_to_existing_with_start_from_beginning_and_events_in_it_obsolete : IClassFixture { diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_start_from_beginning_and_no_stream_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_start_from_beginning_and_no_stream_obsolete.cs similarity index 94% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_start_from_beginning_and_no_stream_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_start_from_beginning_and_no_stream_obsolete.cs index 7e6cecc3b..037ec52e5 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_start_from_beginning_and_no_stream_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_start_from_beginning_and_no_stream_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class connect_to_existing_with_start_from_beginning_and_no_stream_obsolete : IClassFixture { const string Group = "startinbeginning1"; diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_start_from_not_set_and_events_in_it_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_start_from_not_set_and_events_in_it_obsolete.cs similarity index 93% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_start_from_not_set_and_events_in_it_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_start_from_not_set_and_events_in_it_obsolete.cs index 4baa9b373..f0bd49b06 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_start_from_not_set_and_events_in_it_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_start_from_not_set_and_events_in_it_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class connect_to_existing_with_start_from_not_set_and_events_in_it_obsolete : IClassFixture { diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_start_from_not_set_and_events_in_it_then_event_written_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_start_from_not_set_and_events_in_it_then_event_written_obsolete.cs similarity index 94% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_start_from_not_set_and_events_in_it_then_event_written_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_start_from_not_set_and_events_in_it_then_event_written_obsolete.cs index b963c8aea..ea1987ceb 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_start_from_not_set_and_events_in_it_then_event_written_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_start_from_not_set_and_events_in_it_then_event_written_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class connect_to_existing_with_start_from_not_set_and_events_in_it_then_event_written_obsolete : IClassFixture { const string Group = "startinbeginning1"; diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_start_from_set_to_end_position_and_events_in_it_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_start_from_set_to_end_position_and_events_in_it_obsolete.cs similarity index 93% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_start_from_set_to_end_position_and_events_in_it_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_start_from_set_to_end_position_and_events_in_it_obsolete.cs index 53a6d35d0..b25765019 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_start_from_set_to_end_position_and_events_in_it_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_start_from_set_to_end_position_and_events_in_it_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class connect_to_existing_with_start_from_set_to_end_position_and_events_in_it_obsolete : IClassFixture { const string Group = "startinbeginning1"; diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_start_from_set_to_end_position_and_events_in_it_then_event_written_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_start_from_set_to_end_position_and_events_in_it_then_event_written_obsolete.cs similarity index 94% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_start_from_set_to_end_position_and_events_in_it_then_event_written_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_start_from_set_to_end_position_and_events_in_it_then_event_written_obsolete.cs index dd075613e..9bc45141b 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_start_from_set_to_end_position_and_events_in_it_then_event_written_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_start_from_set_to_end_position_and_events_in_it_then_event_written_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class connect_to_existing_with_start_from_set_to_end_position_and_events_in_it_then_event_written_obsolete : IClassFixture< diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_start_from_two_and_no_stream_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_start_from_two_and_no_stream_obsolete.cs similarity index 94% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_start_from_two_and_no_stream_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_start_from_two_and_no_stream_obsolete.cs index 5e172e0bd..09d6e4f21 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_start_from_two_and_no_stream_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_start_from_two_and_no_stream_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class connect_to_existing_with_start_from_two_and_no_stream_obsolete : IClassFixture { const string Group = "startinbeginning1"; diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_start_from_x_set_and_events_in_it_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_start_from_x_set_and_events_in_it_obsolete.cs similarity index 94% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_start_from_x_set_and_events_in_it_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_start_from_x_set_and_events_in_it_obsolete.cs index df18f52f5..c74f8b45f 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_start_from_x_set_and_events_in_it_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_start_from_x_set_and_events_in_it_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class connect_to_existing_with_start_from_x_set_and_events_in_it_obsolete : IClassFixture { const string Group = "startinx2"; diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_start_from_x_set_and_events_in_it_then_event_written_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_start_from_x_set_and_events_in_it_then_event_written_obsolete.cs similarity index 94% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_start_from_x_set_and_events_in_it_then_event_written_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_start_from_x_set_and_events_in_it_then_event_written_obsolete.cs index 82eb4e16d..a3fae30a1 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_start_from_x_set_and_events_in_it_then_event_written_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_start_from_x_set_and_events_in_it_then_event_written_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class connect_to_existing_with_start_from_x_set_and_events_in_it_then_event_written_obsolete : IClassFixture< connect_to_existing_with_start_from_x_set_and_events_in_it_then_event_written_obsolete. diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_start_from_x_set_higher_than_x_and_events_in_it_then_event_written_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_start_from_x_set_higher_than_x_and_events_in_it_then_event_written_obsolete.cs similarity index 94% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_start_from_x_set_higher_than_x_and_events_in_it_then_event_written_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_start_from_x_set_higher_than_x_and_events_in_it_then_event_written_obsolete.cs index c6ca83268..59198a660 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_with_start_from_x_set_higher_than_x_and_events_in_it_then_event_written_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_with_start_from_x_set_higher_than_x_and_events_in_it_then_event_written_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class connect_to_existing_with_start_from_x_set_higher_than_x_and_events_in_it_then_event_written_obsolete : IClassFixture< diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_without_permissions_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_without_permissions_obsolete.cs similarity index 88% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_without_permissions_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_without_permissions_obsolete.cs index fd2249786..25942cd05 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_existing_without_permissions_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_existing_without_permissions_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class connect_to_existing_without_permissions_obsolete : IClassFixture { const string Stream = "$" + nameof(connect_to_existing_without_permissions_obsolete); diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_non_existing_with_permissions_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_non_existing_with_permissions_obsolete.cs similarity index 89% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_non_existing_with_permissions_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_non_existing_with_permissions_obsolete.cs index afbb3abe3..dd9d74900 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_to_non_existing_with_permissions_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_to_non_existing_with_permissions_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class connect_to_non_existing_with_permissions_obsolete : IClassFixture { const string Stream = nameof(connect_to_non_existing_with_permissions_obsolete); diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_with_retries_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_with_retries_obsolete.cs similarity index 93% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_with_retries_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_with_retries_obsolete.cs index 7e0cdcf2d..d31fcc961 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connect_with_retries_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connect_with_retries_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class connect_with_retries_obsolete : IClassFixture { const string Group = "retries"; const string Stream = nameof(connect_with_retries_obsolete); diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connecting_to_a_persistent_subscription_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connecting_to_a_persistent_subscription_obsolete.cs similarity index 94% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connecting_to_a_persistent_subscription_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connecting_to_a_persistent_subscription_obsolete.cs index c8f18ce69..af09f9867 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/connecting_to_a_persistent_subscription_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/connecting_to_a_persistent_subscription_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class connecting_to_a_persistent_subscription_obsolete : IClassFixture< diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/deleting_existing_with_subscriber_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/deleting_existing_with_subscriber_obsolete.cs similarity index 94% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/deleting_existing_with_subscriber_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/deleting_existing_with_subscriber_obsolete.cs index 3a6a5433d..d684c76af 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/deleting_existing_with_subscriber_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/deleting_existing_with_subscriber_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class deleting_existing_with_subscriber_obsolete : IClassFixture { const string Stream = nameof(deleting_existing_with_subscriber_obsolete); diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/get_info_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/get_info_obsolete.cs similarity index 98% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/get_info_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/get_info_obsolete.cs index 6d322d699..34068a937 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/get_info_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/get_info_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class get_info_obsolete : IClassFixture { const string GroupName = nameof(get_info_obsolete); const string StreamName = nameof(get_info_obsolete); diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/happy_case_catching_up_to_link_to_events_manual_ack_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/happy_case_catching_up_to_link_to_events_manual_ack_obsolete.cs similarity index 94% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/happy_case_catching_up_to_link_to_events_manual_ack_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/happy_case_catching_up_to_link_to_events_manual_ack_obsolete.cs index b1cb84438..e69e88fb2 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/happy_case_catching_up_to_link_to_events_manual_ack_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/happy_case_catching_up_to_link_to_events_manual_ack_obsolete.cs @@ -1,8 +1,8 @@ using System.Text; -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class happy_case_catching_up_to_link_to_events_manual_ack_obsolete : IClassFixture { const string Stream = nameof(happy_case_catching_up_to_link_to_events_manual_ack_obsolete); diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/happy_case_catching_up_to_normal_events_manual_ack_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/happy_case_catching_up_to_normal_events_manual_ack_obsolete.cs similarity index 94% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/happy_case_catching_up_to_normal_events_manual_ack_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/happy_case_catching_up_to_normal_events_manual_ack_obsolete.cs index 43a456b1b..6973087cc 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/happy_case_catching_up_to_normal_events_manual_ack_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/happy_case_catching_up_to_normal_events_manual_ack_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class happy_case_catching_up_to_normal_events_manual_ack_obsolete : IClassFixture { const string Stream = nameof(happy_case_catching_up_to_normal_events_manual_ack_obsolete); const string Group = nameof(Group); diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/happy_case_writing_and_subscribing_to_normal_events_manual_ack_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/happy_case_writing_and_subscribing_to_normal_events_manual_ack_obsolete.cs similarity index 94% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/happy_case_writing_and_subscribing_to_normal_events_manual_ack_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/happy_case_writing_and_subscribing_to_normal_events_manual_ack_obsolete.cs index 44377f7cf..af07bcb4c 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/happy_case_writing_and_subscribing_to_normal_events_manual_ack_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/happy_case_writing_and_subscribing_to_normal_events_manual_ack_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class happy_case_writing_and_subscribing_to_normal_events_manual_ack_obsolete : IClassFixture { const string Stream = nameof(happy_case_writing_and_subscribing_to_normal_events_manual_ack_obsolete); diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/update_existing_with_check_point_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/update_existing_with_check_point_obsolete.cs similarity index 96% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/update_existing_with_check_point_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/update_existing_with_check_point_obsolete.cs index 37efd167a..f5922c746 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/update_existing_with_check_point_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/update_existing_with_check_point_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class update_existing_with_check_point_obsolete : IClassFixture { const string Stream = nameof(update_existing_with_check_point_obsolete); diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/update_existing_with_subscribers_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/update_existing_with_subscribers_obsolete.cs similarity index 93% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/update_existing_with_subscribers_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/update_existing_with_subscribers_obsolete.cs index fef96712c..7ff215206 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/update_existing_with_subscribers_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/update_existing_with_subscribers_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class update_existing_with_subscribers_obsolete : IClassFixture { const string Stream = nameof(update_existing_with_subscribers_obsolete); diff --git a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/when_writing_and_subscribing_to_normal_events_manual_nack_obsolete.cs b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/when_writing_and_subscribing_to_normal_events_manual_nack_obsolete.cs similarity index 94% rename from test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/when_writing_and_subscribing_to_normal_events_manual_nack_obsolete.cs rename to test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/when_writing_and_subscribing_to_normal_events_manual_nack_obsolete.cs index f179ad854..96a2d0af0 100644 --- a/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/when_writing_and_subscribing_to_normal_events_manual_nack_obsolete.cs +++ b/test/EventStore.Client.PersistentSubscriptions.Tests/SubscriptionToStream/Obsolete/when_writing_and_subscribing_to_normal_events_manual_nack_obsolete.cs @@ -1,6 +1,6 @@ -namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream; +namespace EventStore.Client.PersistentSubscriptions.Tests.SubscriptionToStream.Obsolete; -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class when_writing_and_subscribing_to_normal_events_manual_nack_obsolete : IClassFixture { const string Stream = nameof(when_writing_and_subscribing_to_normal_events_manual_nack_obsolete); diff --git a/test/EventStore.Client.Streams.Tests/Bugs/Issue_104.cs b/test/EventStore.Client.Streams.Tests/Bugs/Obsolete/Issue_104.cs similarity index 90% rename from test/EventStore.Client.Streams.Tests/Bugs/Issue_104.cs rename to test/EventStore.Client.Streams.Tests/Bugs/Obsolete/Issue_104.cs index cefd65164..922414820 100644 --- a/test/EventStore.Client.Streams.Tests/Bugs/Issue_104.cs +++ b/test/EventStore.Client.Streams.Tests/Bugs/Obsolete/Issue_104.cs @@ -1,7 +1,7 @@ -namespace EventStore.Client.Streams.Tests.Bugs; +namespace EventStore.Client.Streams.Tests.Bugs.Obsolete; [Trait("Category", "Bug")] -[Obsolete] +[Obsolete("Tests will be removed in future release when older subscriptions APIs are removed from the client")] public class Issue_104(ITestOutputHelper output, EventStoreFixture fixture) : EventStoreTests(output, fixture) { [Fact] public async Task subscription_does_not_send_checkpoint_reached_after_disposal() { diff --git a/test/EventStore.Client.Streams.Tests/Bugs/Issue_2544.cs b/test/EventStore.Client.Streams.Tests/Bugs/Obsolete/Issue_2544.cs similarity index 96% rename from test/EventStore.Client.Streams.Tests/Bugs/Issue_2544.cs rename to test/EventStore.Client.Streams.Tests/Bugs/Obsolete/Issue_2544.cs index 10e8b6e75..3d65b01ec 100644 --- a/test/EventStore.Client.Streams.Tests/Bugs/Issue_2544.cs +++ b/test/EventStore.Client.Streams.Tests/Bugs/Obsolete/Issue_2544.cs @@ -1,9 +1,9 @@ #pragma warning disable 1998 -namespace EventStore.Client.Streams.Tests.Bugs; +namespace EventStore.Client.Streams.Tests.Bugs.Obsolete; [Trait("Category", "Bug")] -[Obsolete] +[Obsolete("Tests will be removed in future release when older subscriptions APIs are removed from the client")] public class Issue_2544 : IClassFixture { public Issue_2544(ITestOutputHelper output, EventStoreFixture fixture) { Fixture = fixture.With(x => x.CaptureTestRun(output)); diff --git a/test/EventStore.Client.Streams.Tests/Security/Obsolete/SecurityFixture_obsolete.cs b/test/EventStore.Client.Streams.Tests/Security/Obsolete/SecurityFixture_obsolete.cs new file mode 100644 index 000000000..18b52be82 --- /dev/null +++ b/test/EventStore.Client.Streams.Tests/Security/Obsolete/SecurityFixture_obsolete.cs @@ -0,0 +1,321 @@ +using System.Runtime.CompilerServices; + +namespace EventStore.Client.Streams.Tests.Obsolete; + +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] +public class SecurityFixture_obsolete : EventStoreFixture { + public const string NoAclStream = nameof(NoAclStream); + public const string ReadStream = nameof(ReadStream); + public const string WriteStream = nameof(WriteStream); + public const string MetaReadStream = nameof(MetaReadStream); + public const string MetaWriteStream = nameof(MetaWriteStream); + public const string AllStream = SystemStreams.AllStream; + public const string NormalAllStream = nameof(NormalAllStream); + public const string SystemAllStream = $"${nameof(SystemAllStream)}"; + public const string SystemAdminStream = $"${nameof(SystemAdminStream)}"; + public const string SystemAclStream = $"${nameof(SystemAclStream)}"; + + const int TimeoutMs = 1000; + + public SecurityFixture_obsolete() : base(x => x.WithoutDefaultCredentials()) { + OnSetup = async () => { + await Users.CreateUserWithRetry( + TestCredentials.TestUser1.Username!, + nameof(TestCredentials.TestUser1), + Array.Empty(), + TestCredentials.TestUser1.Password!, + TestCredentials.Root + ).WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs)); + + await Users.CreateUserWithRetry( + TestCredentials.TestUser2.Username!, + nameof(TestCredentials.TestUser2), + Array.Empty(), + TestCredentials.TestUser2.Password!, + TestCredentials.Root + ).WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs)); + + await Users.CreateUserWithRetry( + TestCredentials.TestAdmin.Username!, + nameof(TestCredentials.TestAdmin), + new[] { SystemRoles.Admins }, + TestCredentials.TestAdmin.Password!, + TestCredentials.Root + ).WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs)); + + await Given(); + await When(); + }; + } + + protected virtual async Task Given() { + await Streams.SetStreamMetadataAsync( + NoAclStream, + StreamState.NoStream, + new(), + userCredentials: TestCredentials.TestAdmin + ).WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs)); + + await Streams.SetStreamMetadataAsync( + ReadStream, + StreamState.NoStream, + new(acl: new(TestCredentials.TestUser1.Username)), + userCredentials: TestCredentials.TestAdmin + ).WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs)); + + await Streams.SetStreamMetadataAsync( + WriteStream, + StreamState.NoStream, + new(acl: new(writeRole: TestCredentials.TestUser1.Username)), + userCredentials: TestCredentials.TestAdmin + ).WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs)); + + await Streams.SetStreamMetadataAsync( + MetaReadStream, + StreamState.NoStream, + new(acl: new(metaReadRole: TestCredentials.TestUser1.Username)), + userCredentials: TestCredentials.TestAdmin + ).WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs)); + + await Streams.SetStreamMetadataAsync( + MetaWriteStream, + StreamState.NoStream, + new(acl: new(metaWriteRole: TestCredentials.TestUser1.Username)), + userCredentials: TestCredentials.TestAdmin + ).WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs)); + + await Streams.SetStreamMetadataAsync( + AllStream, + StreamState.Any, + new(acl: new(TestCredentials.TestUser1.Username)), + userCredentials: TestCredentials.TestAdmin + ).WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs)); + + await Streams.SetStreamMetadataAsync( + SystemAclStream, + StreamState.NoStream, + new( + acl: new( + writeRole: TestCredentials.TestUser1.Username, + readRole: TestCredentials.TestUser1.Username, + metaWriteRole: TestCredentials.TestUser1.Username, + metaReadRole: TestCredentials.TestUser1.Username + ) + ), + userCredentials: TestCredentials.TestAdmin + ).WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs)); + + await Streams.SetStreamMetadataAsync( + SystemAdminStream, + StreamState.NoStream, + new( + acl: new( + writeRole: SystemRoles.Admins, + readRole: SystemRoles.Admins, + metaWriteRole: SystemRoles.Admins, + metaReadRole: SystemRoles.Admins + ) + ), + userCredentials: TestCredentials.TestAdmin + ).WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs)); + + await Streams.SetStreamMetadataAsync( + NormalAllStream, + StreamState.NoStream, + new( + acl: new( + writeRole: SystemRoles.All, + readRole: SystemRoles.All, + metaWriteRole: SystemRoles.All, + metaReadRole: SystemRoles.All + ) + ), + userCredentials: TestCredentials.TestAdmin + ).WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs)); + + await Streams.SetStreamMetadataAsync( + SystemAllStream, + StreamState.NoStream, + new( + acl: new( + writeRole: SystemRoles.All, + readRole: SystemRoles.All, + metaWriteRole: SystemRoles.All, + metaReadRole: SystemRoles.All + ) + ), + userCredentials: TestCredentials.TestAdmin + ).WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs)); + } + + protected virtual Task When() => Task.CompletedTask; + + public Task ReadEvent(string streamId, UserCredentials? userCredentials = default) => + Streams.ReadStreamAsync( + Direction.Forwards, + streamId, + StreamPosition.Start, + 1, + false, + userCredentials: userCredentials + ) + .ToArrayAsync() + .AsTask() + .WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs)); + + public Task ReadStreamForward(string streamId, UserCredentials? userCredentials = default) => + Streams.ReadStreamAsync( + Direction.Forwards, + streamId, + StreamPosition.Start, + 1, + false, + userCredentials: userCredentials + ) + .ToArrayAsync() + .AsTask() + .WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs)); + + public Task ReadStreamBackward(string streamId, UserCredentials? userCredentials = default) => + Streams.ReadStreamAsync( + Direction.Backwards, + streamId, + StreamPosition.Start, + 1, + false, + userCredentials: userCredentials + ) + .ToArrayAsync() + .AsTask() + .WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs)); + + public Task AppendStream(string streamId, UserCredentials? userCredentials = default) => + Streams.AppendToStreamAsync( + streamId, + StreamState.Any, + CreateTestEvents(3), + userCredentials: userCredentials + ) + .WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs)); + + public Task ReadAllForward(UserCredentials? userCredentials = default) => + Streams.ReadAllAsync( + Direction.Forwards, + Position.Start, + 1, + false, + userCredentials: userCredentials + ) + .ToArrayAsync() + .AsTask() + .WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs)); + + public Task ReadAllBackward(UserCredentials? userCredentials = default) => + Streams + .ReadAllAsync( + Direction.Backwards, + Position.End, + 1, + false, + userCredentials: userCredentials + ) + .ToArrayAsync() + .AsTask() + .WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs)); + + public Task ReadMeta(string streamId, UserCredentials? userCredentials = default) => + Streams.GetStreamMetadataAsync(streamId, userCredentials: userCredentials) + .WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs)); + + public Task WriteMeta(string streamId, UserCredentials? userCredentials = default, string? role = default) => + Streams.SetStreamMetadataAsync( + streamId, + StreamState.Any, + new( + acl: new( + writeRole: role, + readRole: role, + metaWriteRole: role, + metaReadRole: role + ) + ), + userCredentials: userCredentials + ) + .WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs)); + + [Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client", false)] + public async Task SubscribeToStreamObsolete(string streamId, UserCredentials? userCredentials = default) { + var source = new TaskCompletionSource(); + using (await Streams.SubscribeToStreamAsync( + streamId, + FromStream.Start, + (_, _, _) => { + source.TrySetResult(true); + return Task.CompletedTask; + }, + subscriptionDropped: (_, _, ex) => { + if (ex == null) + source.TrySetResult(true); + else + source.TrySetException(ex); + }, + userCredentials: userCredentials + ).WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs))) { + await source.Task.WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs)); + } + } + + public async Task SubscribeToStream(string streamId, UserCredentials? userCredentials = default) { + await using var subscription = + Streams.SubscribeToStream(streamId, FromStream.Start, userCredentials: userCredentials); + await subscription + .Messages.OfType().AnyAsync().AsTask() + .WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs)); + } + + [Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client", false)] + public async Task SubscribeToAllObsolete(UserCredentials? userCredentials = default) { + var source = new TaskCompletionSource(); + using (await Streams.SubscribeToAllAsync( + FromAll.Start, + (_, _, _) => { + source.TrySetResult(true); + return Task.CompletedTask; + }, + false, + (_, _, ex) => { + if (ex == null) + source.TrySetResult(true); + else + source.TrySetException(ex); + }, + userCredentials: userCredentials + ).WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs))) { + await source.Task.WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs)); + } + } + + public async Task SubscribeToAll(UserCredentials? userCredentials = default) { + await using var subscription = + Streams.SubscribeToAll(FromAll.Start, userCredentials: userCredentials); + await subscription + .Messages.OfType().AnyAsync().AsTask() + .WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs)); + } + + public async Task CreateStreamWithMeta(StreamMetadata metadata, [CallerMemberName] string streamId = "") { + await Streams.SetStreamMetadataAsync( + streamId, + StreamState.NoStream, + metadata, + userCredentials: TestCredentials.TestAdmin + ) + .WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs)); + + return streamId; + } + + public Task DeleteStream(string streamId, UserCredentials? userCredentials = default) => + Streams.TombstoneAsync(streamId, StreamState.Any, userCredentials: userCredentials) + .WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs)); +} diff --git a/test/EventStore.Client.Streams.Tests/Security/Obsolete/all_stream_with_no_acl_security_obsolete.cs b/test/EventStore.Client.Streams.Tests/Security/Obsolete/all_stream_with_no_acl_security_obsolete.cs new file mode 100644 index 000000000..40cdd81ef --- /dev/null +++ b/test/EventStore.Client.Streams.Tests/Security/Obsolete/all_stream_with_no_acl_security_obsolete.cs @@ -0,0 +1,37 @@ +namespace EventStore.Client.Streams.Tests.Obsolete; + +[Trait("Category", "Security")] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] +public class all_stream_with_no_acl_security_obsolete(ITestOutputHelper output, all_stream_with_no_acl_security_obsolete.CustomFixture fixture) : EventStoreTests(output, fixture) { + [Fact] + public async Task reading_and_subscribing_is_not_allowed_when_no_credentials_are_passed() { + await Assert.ThrowsAsync(() => Fixture.ReadAllForward()); + await Assert.ThrowsAsync(() => Fixture.ReadAllBackward()); + await Assert.ThrowsAsync(() => Fixture.ReadMeta(SecurityFixture_obsolete.AllStream)); + await Assert.ThrowsAsync(() => Fixture.SubscribeToAllObsolete()); + } + + [Fact] + public async Task reading_and_subscribing_is_not_allowed_for_usual_user() { + await Assert.ThrowsAsync(() => Fixture.ReadAllForward(TestCredentials.TestUser1)); + await Assert.ThrowsAsync(() => Fixture.ReadAllBackward(TestCredentials.TestUser1)); + await Assert.ThrowsAsync(() => Fixture.ReadMeta(SecurityFixture_obsolete.AllStream, TestCredentials.TestUser1)); + await Assert.ThrowsAsync(() => Fixture.SubscribeToAllObsolete(TestCredentials.TestUser1)); + } + + [Fact] + public async Task reading_and_subscribing_is_allowed_for_admin_user() { + await Fixture.ReadAllForward(TestCredentials.TestAdmin); + await Fixture.ReadAllBackward(TestCredentials.TestAdmin); + await Fixture.ReadMeta(SecurityFixture_obsolete.AllStream, TestCredentials.TestAdmin); + await Fixture.SubscribeToAllObsolete(TestCredentials.TestAdmin); + } + + public class CustomFixture : SecurityFixture_obsolete { + protected override async Task Given() { + await base.Given(); + + await Streams.SetStreamMetadataAsync(AllStream, StreamState.Any, new(), userCredentials: TestCredentials.Root); + } + } +} \ No newline at end of file diff --git a/test/EventStore.Client.Streams.Tests/Security/Obsolete/overriden_system_stream_security_for_all_obsolete.cs b/test/EventStore.Client.Streams.Tests/Security/Obsolete/overriden_system_stream_security_for_all_obsolete.cs new file mode 100644 index 000000000..4593e39e0 --- /dev/null +++ b/test/EventStore.Client.Streams.Tests/Security/Obsolete/overriden_system_stream_security_for_all_obsolete.cs @@ -0,0 +1,70 @@ +namespace EventStore.Client.Streams.Tests.Obsolete; + +[Trait("Category", "Security")] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] +public class overriden_system_stream_security_for_all_obsolete(ITestOutputHelper output, overriden_system_stream_security_for_all_obsolete.CustomFixture fixture) : EventStoreTests(output, fixture) { + [Fact] + public async Task operations_on_system_stream_succeeds_for_user() { + var stream = $"${Fixture.GetStreamName()}"; + await Fixture.AppendStream(stream, TestCredentials.TestUser1); + await Fixture.ReadEvent(stream, TestCredentials.TestUser1); + await Fixture.ReadStreamForward(stream, TestCredentials.TestUser1); + await Fixture.ReadStreamBackward(stream, TestCredentials.TestUser1); + + await Fixture.ReadMeta(stream, TestCredentials.TestUser1); + await Fixture.WriteMeta(stream, TestCredentials.TestUser1); + + await Fixture.SubscribeToStreamObsolete(stream, TestCredentials.TestUser1); + + await Fixture.DeleteStream(stream, TestCredentials.TestUser1); + } + + [AnonymousAccess.Fact] + public async Task operations_on_system_stream_fail_for_anonymous_user() { + var stream = $"${Fixture.GetStreamName()}"; + await Fixture.AppendStream(stream); + await Fixture.ReadEvent(stream); + await Fixture.ReadStreamForward(stream); + await Fixture.ReadStreamBackward(stream); + + await Fixture.ReadMeta(stream); + await Fixture.WriteMeta(stream); + + await Fixture.SubscribeToStreamObsolete(stream); + + await Fixture.DeleteStream(stream); + } + + [Fact] + public async Task operations_on_system_stream_succeed_for_admin() { + var stream = $"${Fixture.GetStreamName()}"; + await Fixture.AppendStream(stream, TestCredentials.TestAdmin); + + await Fixture.ReadEvent(stream, TestCredentials.TestAdmin); + await Fixture.ReadStreamForward(stream, TestCredentials.TestAdmin); + await Fixture.ReadStreamBackward(stream, TestCredentials.TestAdmin); + + await Fixture.ReadMeta(stream, TestCredentials.TestAdmin); + await Fixture.WriteMeta(stream, TestCredentials.TestAdmin); + + await Fixture.SubscribeToStreamObsolete(stream, TestCredentials.TestAdmin); + + await Fixture.DeleteStream(stream, TestCredentials.TestAdmin); + } + + public class CustomFixture : SecurityFixture_obsolete { + protected override Task When() { + var settings = new SystemSettings( + systemStreamAcl: new( + SystemRoles.All, + SystemRoles.All, + SystemRoles.All, + SystemRoles.All, + SystemRoles.All + ) + ); + + return Streams.SetSystemSettingsAsync(settings, userCredentials: TestCredentials.TestAdmin); + } + } +} diff --git a/test/EventStore.Client.Streams.Tests/Security/Obsolete/overriden_system_stream_security_obsolete.cs b/test/EventStore.Client.Streams.Tests/Security/Obsolete/overriden_system_stream_security_obsolete.cs new file mode 100644 index 000000000..f36646be1 --- /dev/null +++ b/test/EventStore.Client.Streams.Tests/Security/Obsolete/overriden_system_stream_security_obsolete.cs @@ -0,0 +1,87 @@ +namespace EventStore.Client.Streams.Tests.Obsolete; + +[Trait("Category", "Security")] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] +public class overriden_system_stream_security_obsolete(ITestOutputHelper output, overriden_system_stream_security_obsolete.CustomFixture fixture) : EventStoreTests(output, fixture) { + [Fact] + public async Task operations_on_system_stream_succeed_for_authorized_user() { + var stream = $"${Fixture.GetStreamName()}"; + await Fixture.AppendStream(stream, TestCredentials.TestUser1); + + await Fixture.ReadEvent(stream, TestCredentials.TestUser1); + await Fixture.ReadStreamForward(stream, TestCredentials.TestUser1); + await Fixture.ReadStreamBackward(stream, TestCredentials.TestUser1); + + await Fixture.ReadMeta(stream, TestCredentials.TestUser1); + await Fixture.WriteMeta(stream, TestCredentials.TestUser1); + + await Fixture.SubscribeToStreamObsolete(stream, TestCredentials.TestUser1); + + await Fixture.DeleteStream(stream, TestCredentials.TestUser1); + } + + [Fact] + public async Task operations_on_system_stream_fail_for_not_authorized_user() { + var stream = $"${Fixture.GetStreamName()}"; + await Assert.ThrowsAsync(() => Fixture.ReadEvent(stream, TestCredentials.TestUser2)); + await Assert.ThrowsAsync(() => Fixture.ReadStreamForward(stream, TestCredentials.TestUser2)); + await Assert.ThrowsAsync( + () => + Fixture.ReadStreamBackward(stream, TestCredentials.TestUser2) + ); + + await Assert.ThrowsAsync(() => Fixture.AppendStream(stream, TestCredentials.TestUser2)); + + await Assert.ThrowsAsync(() => Fixture.ReadMeta(stream, TestCredentials.TestUser2)); + await Assert.ThrowsAsync(() => Fixture.WriteMeta(stream, TestCredentials.TestUser2)); + + await Assert.ThrowsAsync(() => Fixture.SubscribeToStreamObsolete(stream, TestCredentials.TestUser2)); + + await Assert.ThrowsAsync(() => Fixture.DeleteStream(stream, TestCredentials.TestUser2)); + } + + [Fact] + public async Task operations_on_system_stream_fail_for_anonymous_user() { + var stream = $"${Fixture.GetStreamName()}"; + await Assert.ThrowsAsync(() => Fixture.ReadEvent(stream)); + await Assert.ThrowsAsync(() => Fixture.ReadStreamForward(stream)); + await Assert.ThrowsAsync(() => Fixture.ReadStreamBackward(stream)); + + await Assert.ThrowsAsync(() => Fixture.AppendStream(stream)); + + await Assert.ThrowsAsync(() => Fixture.ReadMeta(stream)); + await Assert.ThrowsAsync(() => Fixture.WriteMeta(stream)); + + await Assert.ThrowsAsync(() => Fixture.SubscribeToStreamObsolete(stream)); + + await Assert.ThrowsAsync(() => Fixture.DeleteStream(stream)); + } + + [Fact] + public async Task operations_on_system_stream_succeed_for_admin() { + var stream = $"${Fixture.GetStreamName()}"; + await Fixture.AppendStream(stream, TestCredentials.TestAdmin); + + await Fixture.ReadEvent(stream, TestCredentials.TestAdmin); + await Fixture.ReadStreamForward(stream, TestCredentials.TestAdmin); + await Fixture.ReadStreamBackward(stream, TestCredentials.TestAdmin); + + await Fixture.ReadMeta(stream, TestCredentials.TestAdmin); + await Fixture.WriteMeta(stream, TestCredentials.TestAdmin); + + await Fixture.SubscribeToStreamObsolete(stream, TestCredentials.TestAdmin); + + await Fixture.DeleteStream(stream, TestCredentials.TestAdmin); + } + + public class CustomFixture : SecurityFixture_obsolete { + protected override Task When() { + var settings = new SystemSettings( + systemStreamAcl: new("user1", "user1", "user1", "user1", "user1"), + userStreamAcl: default + ); + + return Streams.SetSystemSettingsAsync(settings, userCredentials: TestCredentials.TestAdmin); + } + } +} diff --git a/test/EventStore.Client.Streams.Tests/Security/Obsolete/overriden_user_stream_security_obsolete.cs b/test/EventStore.Client.Streams.Tests/Security/Obsolete/overriden_user_stream_security_obsolete.cs new file mode 100644 index 000000000..dcbd88fa1 --- /dev/null +++ b/test/EventStore.Client.Streams.Tests/Security/Obsolete/overriden_user_stream_security_obsolete.cs @@ -0,0 +1,78 @@ +namespace EventStore.Client.Streams.Tests.Obsolete; + +[Trait("Category", "Security")] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] +public class overriden_user_stream_security_obsolete(ITestOutputHelper output, overriden_user_stream_security_obsolete.CustomFixture fixture) : EventStoreTests(output, fixture) { + [Fact] + public async Task operations_on_user_stream_succeeds_for_authorized_user() { + var stream = Fixture.GetStreamName(); + await Fixture.AppendStream(stream, TestCredentials.TestUser1); + + await Fixture.ReadEvent(stream, TestCredentials.TestUser1); + await Fixture.ReadStreamForward(stream, TestCredentials.TestUser1); + await Fixture.ReadStreamBackward(stream, TestCredentials.TestUser1); + + await Fixture.ReadMeta(stream, TestCredentials.TestUser1); + await Fixture.WriteMeta(stream, TestCredentials.TestUser1); + + await Fixture.SubscribeToStreamObsolete(stream, TestCredentials.TestUser1); + + await Fixture.DeleteStream(stream, TestCredentials.TestUser1); + } + + [Fact] + public async Task operations_on_user_stream_fail_for_not_authorized_user() { + var stream = Fixture.GetStreamName(); + await Assert.ThrowsAsync(() => Fixture.ReadEvent(stream, TestCredentials.TestUser2)); + await Assert.ThrowsAsync(() => Fixture.ReadStreamForward(stream, TestCredentials.TestUser2)); + await Assert.ThrowsAsync(() => Fixture.ReadStreamBackward(stream, TestCredentials.TestUser2)); + + await Assert.ThrowsAsync(() => Fixture.AppendStream(stream, TestCredentials.TestUser2)); + await Assert.ThrowsAsync(() => Fixture.ReadMeta(stream, TestCredentials.TestUser2)); + await Assert.ThrowsAsync(() => Fixture.WriteMeta(stream, TestCredentials.TestUser2)); + + await Assert.ThrowsAsync(() => Fixture.SubscribeToStreamObsolete(stream, TestCredentials.TestUser2)); + + await Assert.ThrowsAsync(() => Fixture.DeleteStream(stream, TestCredentials.TestUser2)); + } + + [Fact] + public async Task operations_on_user_stream_fail_for_anonymous_user() { + var stream = Fixture.GetStreamName(); + await Assert.ThrowsAsync(() => Fixture.ReadEvent(stream)); + await Assert.ThrowsAsync(() => Fixture.ReadStreamForward(stream)); + await Assert.ThrowsAsync(() => Fixture.ReadStreamBackward(stream)); + + await Assert.ThrowsAsync(() => Fixture.AppendStream(stream)); + await Assert.ThrowsAsync(() => Fixture.ReadMeta(stream)); + await Assert.ThrowsAsync(() => Fixture.WriteMeta(stream)); + + await Assert.ThrowsAsync(() => Fixture.SubscribeToStreamObsolete(stream)); + + await Assert.ThrowsAsync(() => Fixture.DeleteStream(stream)); + } + + [Fact] + public async Task operations_on_user_stream_succeed_for_admin() { + var stream = Fixture.GetStreamName(); + await Fixture.AppendStream(stream, TestCredentials.TestAdmin); + + await Fixture.ReadEvent(stream, TestCredentials.TestAdmin); + await Fixture.ReadStreamForward(stream, TestCredentials.TestAdmin); + await Fixture.ReadStreamBackward(stream, TestCredentials.TestAdmin); + + await Fixture.ReadMeta(stream, TestCredentials.TestAdmin); + await Fixture.WriteMeta(stream, TestCredentials.TestAdmin); + + await Fixture.SubscribeToStreamObsolete(stream, TestCredentials.TestAdmin); + + await Fixture.DeleteStream(stream, TestCredentials.TestAdmin); + } + + public class CustomFixture : SecurityFixture_obsolete { + protected override Task When() { + var settings = new SystemSettings(new("user1", "user1", "user1", "user1", "user1")); + return Streams.SetSystemSettingsAsync(settings, userCredentials: TestCredentials.TestAdmin); + } + } +} diff --git a/test/EventStore.Client.Streams.Tests/Security/Obsolete/subscribe_to_all_security_obsolete.cs b/test/EventStore.Client.Streams.Tests/Security/Obsolete/subscribe_to_all_security_obsolete.cs new file mode 100644 index 000000000..b21cf66c6 --- /dev/null +++ b/test/EventStore.Client.Streams.Tests/Security/Obsolete/subscribe_to_all_security_obsolete.cs @@ -0,0 +1,22 @@ +namespace EventStore.Client.Streams.Tests.Obsolete; + +[Trait("Category", "Security")] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] +public class subscribe_to_all_security_obsolete(ITestOutputHelper output, SecurityFixture_obsolete fixture) : EventStoreTests(output, fixture) { + [Fact] + public async Task subscribing_to_all_with_not_existing_credentials_is_not_authenticated() => + await Assert.ThrowsAsync(() => Fixture.SubscribeToAllObsolete(TestCredentials.TestBadUser)); + + [Fact] + public async Task subscribing_to_all_with_no_credentials_is_denied() => await Assert.ThrowsAsync(() => Fixture.SubscribeToAllObsolete()); + + [Fact] + public async Task subscribing_to_all_with_not_authorized_user_credentials_is_denied() => + await Assert.ThrowsAsync(() => Fixture.SubscribeToAllObsolete(TestCredentials.TestUser2)); + + [Fact] + public async Task subscribing_to_all_with_authorized_user_credentials_succeeds() => await Fixture.SubscribeToAllObsolete(TestCredentials.TestUser1); + + [Fact] + public async Task subscribing_to_all_with_admin_user_credentials_succeeds() => await Fixture.SubscribeToAllObsolete(TestCredentials.TestAdmin); +} \ No newline at end of file diff --git a/test/EventStore.Client.Streams.Tests/Security/Obsolete/subscribe_to_stream_security_obsolete.cs b/test/EventStore.Client.Streams.Tests/Security/Obsolete/subscribe_to_stream_security_obsolete.cs new file mode 100644 index 000000000..409256650 --- /dev/null +++ b/test/EventStore.Client.Streams.Tests/Security/Obsolete/subscribe_to_stream_security_obsolete.cs @@ -0,0 +1,75 @@ +namespace EventStore.Client.Streams.Tests.Obsolete; + +[Trait("Category", "Security")] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] +public class subscribe_to_stream_security_obsolete(ITestOutputHelper output, SecurityFixture_obsolete fixture) : EventStoreTests(output, fixture) { + [Fact] + public async Task subscribing_to_stream_with_not_existing_credentials_is_not_authenticated() => + await Assert.ThrowsAsync(() => Fixture.SubscribeToStreamObsolete(SecurityFixture_obsolete.ReadStream, TestCredentials.TestBadUser)); + + [Fact] + public async Task subscribing_to_stream_with_no_credentials_is_denied() => + await Assert.ThrowsAsync(() => Fixture.SubscribeToStreamObsolete(SecurityFixture_obsolete.ReadStream)); + + [Fact] + public async Task subscribing_to_stream_with_not_authorized_user_credentials_is_denied() => + await Assert.ThrowsAsync(() => Fixture.SubscribeToStreamObsolete(SecurityFixture_obsolete.ReadStream, TestCredentials.TestUser2)); + + [Fact] + public async Task reading_stream_with_authorized_user_credentials_succeeds() { + await Fixture.AppendStream(SecurityFixture_obsolete.ReadStream, TestCredentials.TestUser1); + await Fixture.SubscribeToStreamObsolete(SecurityFixture_obsolete.ReadStream, TestCredentials.TestUser1); + } + + [Fact] + public async Task reading_stream_with_admin_user_credentials_succeeds() { + await Fixture.AppendStream(SecurityFixture_obsolete.ReadStream, TestCredentials.TestAdmin); + await Fixture.SubscribeToStreamObsolete(SecurityFixture_obsolete.ReadStream, TestCredentials.TestAdmin); + } + + [AnonymousAccess.Fact] + public async Task subscribing_to_no_acl_stream_succeeds_when_no_credentials_are_passed() { + await Fixture.AppendStream(SecurityFixture_obsolete.NoAclStream); + await Fixture.SubscribeToStreamObsolete(SecurityFixture_obsolete.NoAclStream); + } + + [Fact] + public async Task subscribing_to_no_acl_stream_is_not_authenticated_when_not_existing_credentials_are_passed() => + await Assert.ThrowsAsync(() => Fixture.SubscribeToStreamObsolete(SecurityFixture_obsolete.NoAclStream, TestCredentials.TestBadUser)); + + [Fact] + public async Task subscribing_to_no_acl_stream_succeeds_when_any_existing_user_credentials_are_passed() { + await Fixture.AppendStream(SecurityFixture_obsolete.NoAclStream, TestCredentials.TestUser1); + await Fixture.SubscribeToStreamObsolete(SecurityFixture_obsolete.NoAclStream, TestCredentials.TestUser1); + await Fixture.SubscribeToStreamObsolete(SecurityFixture_obsolete.NoAclStream, TestCredentials.TestUser2); + } + + [Fact] + public async Task subscribing_to_no_acl_stream_succeeds_when_admin_user_credentials_are_passed() { + await Fixture.AppendStream(SecurityFixture_obsolete.NoAclStream, TestCredentials.TestAdmin); + await Fixture.SubscribeToStreamObsolete(SecurityFixture_obsolete.NoAclStream, TestCredentials.TestAdmin); + } + + [AnonymousAccess.Fact] + public async Task subscribing_to_all_access_normal_stream_succeeds_when_no_credentials_are_passed() { + await Fixture.AppendStream(SecurityFixture_obsolete.NormalAllStream); + await Fixture.SubscribeToStreamObsolete(SecurityFixture_obsolete.NormalAllStream); + } + + [Fact] + public async Task subscribing_to_all_access_normal_stream_is_not_authenticated_when_not_existing_credentials_are_passed() => + await Assert.ThrowsAsync(() => Fixture.SubscribeToStreamObsolete(SecurityFixture_obsolete.NormalAllStream, TestCredentials.TestBadUser)); + + [Fact] + public async Task subscribing_to_all_access_normal_stream_succeeds_when_any_existing_user_credentials_are_passed() { + await Fixture.AppendStream(SecurityFixture_obsolete.NormalAllStream, TestCredentials.TestUser1); + await Fixture.SubscribeToStreamObsolete(SecurityFixture_obsolete.NormalAllStream, TestCredentials.TestUser1); + await Fixture.SubscribeToStreamObsolete(SecurityFixture_obsolete.NormalAllStream, TestCredentials.TestUser2); + } + + [Fact] + public async Task subscribing_to_all_access_normal_streamm_succeeds_when_admin_user_credentials_are_passed() { + await Fixture.AppendStream(SecurityFixture_obsolete.NormalAllStream, TestCredentials.TestAdmin); + await Fixture.SubscribeToStreamObsolete(SecurityFixture_obsolete.NormalAllStream, TestCredentials.TestAdmin); + } +} diff --git a/test/EventStore.Client.Streams.Tests/Security/Obsolete/system_stream_security_obsolete.cs b/test/EventStore.Client.Streams.Tests/Security/Obsolete/system_stream_security_obsolete.cs new file mode 100644 index 000000000..462696ff2 --- /dev/null +++ b/test/EventStore.Client.Streams.Tests/Security/Obsolete/system_stream_security_obsolete.cs @@ -0,0 +1,146 @@ +namespace EventStore.Client.Streams.Tests.Obsolete; + +[Trait("Category", "Security")] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] +public class system_stream_security_obsolete(ITestOutputHelper output, SecurityFixture_obsolete fixture) : EventStoreTests(output, fixture) { + [Fact] + public async Task operations_on_system_stream_with_no_acl_set_fail_for_non_admin() { + await Assert.ThrowsAsync(() => Fixture.ReadEvent("$system-no-acl", TestCredentials.TestUser1)); + await Assert.ThrowsAsync(() => Fixture.ReadStreamForward("$system-no-acl", TestCredentials.TestUser1)); + + await Assert.ThrowsAsync(() => Fixture.ReadStreamBackward("$system-no-acl", TestCredentials.TestUser1)); + + await Assert.ThrowsAsync(() => Fixture.AppendStream("$system-no-acl", TestCredentials.TestUser1)); + + await Assert.ThrowsAsync(() => Fixture.ReadMeta("$system-no-acl", TestCredentials.TestUser1)); + await Assert.ThrowsAsync(() => Fixture.WriteMeta("$system-no-acl", TestCredentials.TestUser1)); + + await Assert.ThrowsAsync(() => Fixture.SubscribeToStreamObsolete("$system-no-acl", TestCredentials.TestUser1)); + } + + [Fact] + public async Task operations_on_system_stream_with_no_acl_set_succeed_for_admin() { + await Fixture.AppendStream("$system-no-acl", TestCredentials.TestAdmin); + + await Fixture.ReadEvent("$system-no-acl", TestCredentials.TestAdmin); + await Fixture.ReadStreamForward("$system-no-acl", TestCredentials.TestAdmin); + await Fixture.ReadStreamBackward("$system-no-acl", TestCredentials.TestAdmin); + + await Fixture.ReadMeta("$system-no-acl", TestCredentials.TestAdmin); + await Fixture.WriteMeta("$system-no-acl", TestCredentials.TestAdmin); + + await Fixture.SubscribeToStreamObsolete("$system-no-acl", TestCredentials.TestAdmin); + } + + [Fact] + public async Task operations_on_system_stream_with_acl_set_to_usual_user_fail_for_not_authorized_user() { + await Assert.ThrowsAsync(() => Fixture.ReadEvent(SecurityFixture_obsolete.SystemAclStream, TestCredentials.TestUser2)); + await Assert.ThrowsAsync(() => Fixture.ReadStreamForward(SecurityFixture_obsolete.SystemAclStream, TestCredentials.TestUser2)); + await Assert.ThrowsAsync(() => Fixture.ReadStreamBackward(SecurityFixture_obsolete.SystemAclStream, TestCredentials.TestUser2)); + + await Assert.ThrowsAsync(() => Fixture.AppendStream(SecurityFixture_obsolete.SystemAclStream, TestCredentials.TestUser2)); + + await Assert.ThrowsAsync(() => Fixture.ReadMeta(SecurityFixture_obsolete.SystemAclStream, TestCredentials.TestUser2)); + await Assert.ThrowsAsync(() => Fixture.WriteMeta(SecurityFixture_obsolete.SystemAclStream, TestCredentials.TestUser2, TestCredentials.TestUser1.Username)); + + await Assert.ThrowsAsync(() => Fixture.SubscribeToStreamObsolete(SecurityFixture_obsolete.SystemAclStream, TestCredentials.TestUser2)); + } + + [Fact] + public async Task operations_on_system_stream_with_acl_set_to_usual_user_succeed_for_that_user() { + await Fixture.AppendStream(SecurityFixture_obsolete.SystemAclStream, TestCredentials.TestUser1); + await Fixture.ReadEvent(SecurityFixture_obsolete.SystemAclStream, TestCredentials.TestUser1); + await Fixture.ReadStreamForward(SecurityFixture_obsolete.SystemAclStream, TestCredentials.TestUser1); + await Fixture.ReadStreamBackward(SecurityFixture_obsolete.SystemAclStream, TestCredentials.TestUser1); + + await Fixture.ReadMeta(SecurityFixture_obsolete.SystemAclStream, TestCredentials.TestUser1); + await Fixture.WriteMeta(SecurityFixture_obsolete.SystemAclStream, TestCredentials.TestUser1, TestCredentials.TestUser1.Username); + + await Fixture.SubscribeToStreamObsolete(SecurityFixture_obsolete.SystemAclStream, TestCredentials.TestUser1); + } + + [Fact] + public async Task operations_on_system_stream_with_acl_set_to_usual_user_succeed_for_admin() { + await Fixture.AppendStream(SecurityFixture_obsolete.SystemAclStream, TestCredentials.TestAdmin); + await Fixture.ReadEvent(SecurityFixture_obsolete.SystemAclStream, TestCredentials.TestAdmin); + await Fixture.ReadStreamForward(SecurityFixture_obsolete.SystemAclStream, TestCredentials.TestAdmin); + await Fixture.ReadStreamBackward(SecurityFixture_obsolete.SystemAclStream, TestCredentials.TestAdmin); + + await Fixture.ReadMeta(SecurityFixture_obsolete.SystemAclStream, TestCredentials.TestAdmin); + await Fixture.WriteMeta(SecurityFixture_obsolete.SystemAclStream, TestCredentials.TestAdmin, TestCredentials.TestUser1.Username); + + await Fixture.SubscribeToStreamObsolete(SecurityFixture_obsolete.SystemAclStream, TestCredentials.TestAdmin); + } + + [Fact] + public async Task operations_on_system_stream_with_acl_set_to_admins_fail_for_usual_user() { + await Assert.ThrowsAsync(() => Fixture.ReadEvent(SecurityFixture_obsolete.SystemAdminStream, TestCredentials.TestUser1)); + await Assert.ThrowsAsync(() => Fixture.ReadStreamForward(SecurityFixture_obsolete.SystemAdminStream, TestCredentials.TestUser1)); + await Assert.ThrowsAsync( + () => + Fixture.ReadStreamBackward(SecurityFixture_obsolete.SystemAdminStream, TestCredentials.TestUser1) + ); + + await Assert.ThrowsAsync(() => Fixture.AppendStream(SecurityFixture_obsolete.SystemAdminStream, TestCredentials.TestUser1)); + + await Assert.ThrowsAsync(() => Fixture.ReadMeta(SecurityFixture_obsolete.SystemAdminStream, TestCredentials.TestUser1)); + await Assert.ThrowsAsync( + () => + Fixture.WriteMeta(SecurityFixture_obsolete.SystemAdminStream, TestCredentials.TestUser1, SystemRoles.Admins) + ); + + await Assert.ThrowsAsync(() => Fixture.SubscribeToStreamObsolete(SecurityFixture_obsolete.SystemAdminStream, TestCredentials.TestUser1)); + } + + [Fact] + public async Task operations_on_system_stream_with_acl_set_to_admins_succeed_for_admin() { + await Fixture.AppendStream(SecurityFixture_obsolete.SystemAdminStream, TestCredentials.TestAdmin); + await Fixture.ReadEvent(SecurityFixture_obsolete.SystemAdminStream, TestCredentials.TestAdmin); + await Fixture.ReadStreamForward(SecurityFixture_obsolete.SystemAdminStream, TestCredentials.TestAdmin); + await Fixture.ReadStreamBackward(SecurityFixture_obsolete.SystemAdminStream, TestCredentials.TestAdmin); + + await Fixture.ReadMeta(SecurityFixture_obsolete.SystemAdminStream, TestCredentials.TestAdmin); + await Fixture.WriteMeta(SecurityFixture_obsolete.SystemAdminStream, TestCredentials.TestAdmin, SystemRoles.Admins); + + await Fixture.SubscribeToStreamObsolete(SecurityFixture_obsolete.SystemAdminStream, TestCredentials.TestAdmin); + } + + [AnonymousAccess.Fact] + public async Task operations_on_system_stream_with_acl_set_to_all_succeed_for_not_authenticated_user() { + await Fixture.AppendStream(SecurityFixture_obsolete.SystemAllStream); + await Fixture.ReadEvent(SecurityFixture_obsolete.SystemAllStream); + await Fixture.ReadStreamForward(SecurityFixture_obsolete.SystemAllStream); + await Fixture.ReadStreamBackward(SecurityFixture_obsolete.SystemAllStream); + + await Fixture.ReadMeta(SecurityFixture_obsolete.SystemAllStream); + await Fixture.WriteMeta(SecurityFixture_obsolete.SystemAllStream, role: SystemRoles.All); + + await Fixture.SubscribeToStreamObsolete(SecurityFixture_obsolete.SystemAllStream); + } + + [Fact] + public async Task operations_on_system_stream_with_acl_set_to_all_succeed_for_usual_user() { + await Fixture.AppendStream(SecurityFixture_obsolete.SystemAllStream, TestCredentials.TestUser1); + await Fixture.ReadEvent(SecurityFixture_obsolete.SystemAllStream, TestCredentials.TestUser1); + await Fixture.ReadStreamForward(SecurityFixture_obsolete.SystemAllStream, TestCredentials.TestUser1); + await Fixture.ReadStreamBackward(SecurityFixture_obsolete.SystemAllStream, TestCredentials.TestUser1); + + await Fixture.ReadMeta(SecurityFixture_obsolete.SystemAllStream, TestCredentials.TestUser1); + await Fixture.WriteMeta(SecurityFixture_obsolete.SystemAllStream, TestCredentials.TestUser1, SystemRoles.All); + + await Fixture.SubscribeToStreamObsolete(SecurityFixture_obsolete.SystemAllStream, TestCredentials.TestUser1); + } + + [Fact] + public async Task operations_on_system_stream_with_acl_set_to_all_succeed_for_admin() { + await Fixture.AppendStream(SecurityFixture_obsolete.SystemAllStream, TestCredentials.TestAdmin); + await Fixture.ReadEvent(SecurityFixture_obsolete.SystemAllStream, TestCredentials.TestAdmin); + await Fixture.ReadStreamForward(SecurityFixture_obsolete.SystemAllStream, TestCredentials.TestAdmin); + await Fixture.ReadStreamBackward(SecurityFixture_obsolete.SystemAllStream, TestCredentials.TestAdmin); + + await Fixture.ReadMeta(SecurityFixture_obsolete.SystemAllStream, TestCredentials.TestAdmin); + await Fixture.WriteMeta(SecurityFixture_obsolete.SystemAllStream, TestCredentials.TestAdmin, SystemRoles.All); + + await Fixture.SubscribeToStreamObsolete(SecurityFixture_obsolete.SystemAllStream, TestCredentials.TestAdmin); + } +} diff --git a/test/EventStore.Client.Streams.Tests/Security/SecurityFixture.cs b/test/EventStore.Client.Streams.Tests/Security/SecurityFixture.cs index f97789b91..2ffc0b73c 100644 --- a/test/EventStore.Client.Streams.Tests/Security/SecurityFixture.cs +++ b/test/EventStore.Client.Streams.Tests/Security/SecurityFixture.cs @@ -242,28 +242,6 @@ public Task WriteMeta(string streamId, UserCredentials? userCreden ) .WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs)); - [Obsolete] - public async Task SubscribeToStreamObsolete(string streamId, UserCredentials? userCredentials = default) { - var source = new TaskCompletionSource(); - using (await Streams.SubscribeToStreamAsync( - streamId, - FromStream.Start, - (_, _, _) => { - source.TrySetResult(true); - return Task.CompletedTask; - }, - subscriptionDropped: (_, _, ex) => { - if (ex == null) - source.TrySetResult(true); - else - source.TrySetException(ex); - }, - userCredentials: userCredentials - ).WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs))) { - await source.Task.WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs)); - } - } - public async Task SubscribeToStream(string streamId, UserCredentials? userCredentials = default) { await using var subscription = Streams.SubscribeToStream(streamId, FromStream.Start, userCredentials: userCredentials); @@ -272,28 +250,14 @@ await subscription .WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs)); } - [Obsolete] - public async Task SubscribeToAllObsolete(UserCredentials? userCredentials = default) { - var source = new TaskCompletionSource(); - using (await Streams.SubscribeToAllAsync( - FromAll.Start, - (_, _, _) => { - source.TrySetResult(true); - return Task.CompletedTask; - }, - false, - (_, _, ex) => { - if (ex == null) - source.TrySetResult(true); - else - source.TrySetException(ex); - }, - userCredentials: userCredentials - ).WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs))) { - await source.Task.WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs)); - } + public async Task SubscribeToAll(UserCredentials? userCredentials = default) { + await using var subscription = + Streams.SubscribeToAll(FromAll.Start, userCredentials: userCredentials); + await subscription + .Messages.OfType().AnyAsync().AsTask() + .WithTimeout(TimeSpan.FromMilliseconds(TimeoutMs)); } - + public async Task CreateStreamWithMeta(StreamMetadata metadata, [CallerMemberName] string streamId = "") { await Streams.SetStreamMetadataAsync( streamId, diff --git a/test/EventStore.Client.Streams.Tests/Security/all_stream_with_no_acl_security.cs b/test/EventStore.Client.Streams.Tests/Security/all_stream_with_no_acl_security.cs index d5ab0cc1a..215e0f05d 100644 --- a/test/EventStore.Client.Streams.Tests/Security/all_stream_with_no_acl_security.cs +++ b/test/EventStore.Client.Streams.Tests/Security/all_stream_with_no_acl_security.cs @@ -21,7 +21,7 @@ public async Task reading_and_subscribing_is_not_allowed_when_no_credentials_are await Assert.ThrowsAsync(() => Fixture.ReadAllForward()); await Assert.ThrowsAsync(() => Fixture.ReadAllBackward()); await Assert.ThrowsAsync(() => Fixture.ReadMeta(SecurityFixture.AllStream)); - await Assert.ThrowsAsync(() => Fixture.SubscribeToAllObsolete()); + await Assert.ThrowsAsync(() => Fixture.SubscribeToAll()); } [Fact] @@ -29,7 +29,7 @@ public async Task reading_and_subscribing_is_not_allowed_for_usual_user() { await Assert.ThrowsAsync(() => Fixture.ReadAllForward(TestCredentials.TestUser1)); await Assert.ThrowsAsync(() => Fixture.ReadAllBackward(TestCredentials.TestUser1)); await Assert.ThrowsAsync(() => Fixture.ReadMeta(SecurityFixture.AllStream, TestCredentials.TestUser1)); - await Assert.ThrowsAsync(() => Fixture.SubscribeToAllObsolete(TestCredentials.TestUser1)); + await Assert.ThrowsAsync(() => Fixture.SubscribeToAll(TestCredentials.TestUser1)); } [Fact] @@ -37,7 +37,7 @@ public async Task reading_and_subscribing_is_allowed_for_admin_user() { await Fixture.ReadAllForward(TestCredentials.TestAdmin); await Fixture.ReadAllBackward(TestCredentials.TestAdmin); await Fixture.ReadMeta(SecurityFixture.AllStream, TestCredentials.TestAdmin); - await Fixture.SubscribeToAllObsolete(TestCredentials.TestAdmin); + await Fixture.SubscribeToAll(TestCredentials.TestAdmin); } [Fact] diff --git a/test/EventStore.Client.Streams.Tests/Security/overriden_system_stream_security.cs b/test/EventStore.Client.Streams.Tests/Security/overriden_system_stream_security.cs index 6dd93a3c9..fcdaec541 100644 --- a/test/EventStore.Client.Streams.Tests/Security/overriden_system_stream_security.cs +++ b/test/EventStore.Client.Streams.Tests/Security/overriden_system_stream_security.cs @@ -15,7 +15,6 @@ public async Task operations_on_system_stream_succeed_for_authorized_user() { await Fixture.WriteMeta(stream, TestCredentials.TestUser1); await Fixture.SubscribeToStream(stream, TestCredentials.TestUser1); - await Fixture.SubscribeToStreamObsolete(stream, TestCredentials.TestUser1); await Fixture.DeleteStream(stream, TestCredentials.TestUser1); } @@ -36,7 +35,6 @@ await Assert.ThrowsAsync( await Assert.ThrowsAsync(() => Fixture.WriteMeta(stream, TestCredentials.TestUser2)); await Assert.ThrowsAsync(() => Fixture.SubscribeToStream(stream, TestCredentials.TestUser2)); - await Assert.ThrowsAsync(() => Fixture.SubscribeToStreamObsolete(stream, TestCredentials.TestUser2)); await Assert.ThrowsAsync(() => Fixture.DeleteStream(stream, TestCredentials.TestUser2)); } @@ -54,7 +52,6 @@ public async Task operations_on_system_stream_fail_for_anonymous_user() { await Assert.ThrowsAsync(() => Fixture.WriteMeta(stream)); await Assert.ThrowsAsync(() => Fixture.SubscribeToStream(stream)); - await Assert.ThrowsAsync(() => Fixture.SubscribeToStreamObsolete(stream)); await Assert.ThrowsAsync(() => Fixture.DeleteStream(stream)); } @@ -72,7 +69,6 @@ public async Task operations_on_system_stream_succeed_for_admin() { await Fixture.WriteMeta(stream, TestCredentials.TestAdmin); await Fixture.SubscribeToStream(stream, TestCredentials.TestAdmin); - await Fixture.SubscribeToStreamObsolete(stream, TestCredentials.TestAdmin); await Fixture.DeleteStream(stream, TestCredentials.TestAdmin); } diff --git a/test/EventStore.Client.Streams.Tests/Security/overriden_system_stream_security_for_all.cs b/test/EventStore.Client.Streams.Tests/Security/overriden_system_stream_security_for_all.cs index df1153449..2364717bb 100644 --- a/test/EventStore.Client.Streams.Tests/Security/overriden_system_stream_security_for_all.cs +++ b/test/EventStore.Client.Streams.Tests/Security/overriden_system_stream_security_for_all.cs @@ -14,7 +14,6 @@ public async Task operations_on_system_stream_succeeds_for_user() { await Fixture.WriteMeta(stream, TestCredentials.TestUser1); await Fixture.SubscribeToStream(stream, TestCredentials.TestUser1); - await Fixture.SubscribeToStreamObsolete(stream, TestCredentials.TestUser1); await Fixture.DeleteStream(stream, TestCredentials.TestUser1); } @@ -31,7 +30,6 @@ public async Task operations_on_system_stream_fail_for_anonymous_user() { await Fixture.WriteMeta(stream); await Fixture.SubscribeToStream(stream); - await Fixture.SubscribeToStreamObsolete(stream); await Fixture.DeleteStream(stream); } @@ -49,7 +47,6 @@ public async Task operations_on_system_stream_succeed_for_admin() { await Fixture.WriteMeta(stream, TestCredentials.TestAdmin); await Fixture.SubscribeToStream(stream, TestCredentials.TestAdmin); - await Fixture.SubscribeToStreamObsolete(stream, TestCredentials.TestAdmin); await Fixture.DeleteStream(stream, TestCredentials.TestAdmin); } diff --git a/test/EventStore.Client.Streams.Tests/Security/overriden_user_stream_security.cs b/test/EventStore.Client.Streams.Tests/Security/overriden_user_stream_security.cs index a7cf4a5e4..287d5a64f 100644 --- a/test/EventStore.Client.Streams.Tests/Security/overriden_user_stream_security.cs +++ b/test/EventStore.Client.Streams.Tests/Security/overriden_user_stream_security.cs @@ -15,7 +15,6 @@ public async Task operations_on_user_stream_succeeds_for_authorized_user() { await Fixture.WriteMeta(stream, TestCredentials.TestUser1); await Fixture.SubscribeToStream(stream, TestCredentials.TestUser1); - await Fixture.SubscribeToStreamObsolete(stream, TestCredentials.TestUser1); await Fixture.DeleteStream(stream, TestCredentials.TestUser1); } @@ -32,7 +31,6 @@ public async Task operations_on_user_stream_fail_for_not_authorized_user() { await Assert.ThrowsAsync(() => Fixture.WriteMeta(stream, TestCredentials.TestUser2)); await Assert.ThrowsAsync(() => Fixture.SubscribeToStream(stream, TestCredentials.TestUser2)); - await Assert.ThrowsAsync(() => Fixture.SubscribeToStreamObsolete(stream, TestCredentials.TestUser2)); await Assert.ThrowsAsync(() => Fixture.DeleteStream(stream, TestCredentials.TestUser2)); } @@ -49,7 +47,6 @@ public async Task operations_on_user_stream_fail_for_anonymous_user() { await Assert.ThrowsAsync(() => Fixture.WriteMeta(stream)); await Assert.ThrowsAsync(() => Fixture.SubscribeToStream(stream)); - await Assert.ThrowsAsync(() => Fixture.SubscribeToStreamObsolete(stream)); await Assert.ThrowsAsync(() => Fixture.DeleteStream(stream)); } @@ -67,7 +64,6 @@ public async Task operations_on_user_stream_succeed_for_admin() { await Fixture.WriteMeta(stream, TestCredentials.TestAdmin); await Fixture.SubscribeToStream(stream, TestCredentials.TestAdmin); - await Fixture.SubscribeToStreamObsolete(stream, TestCredentials.TestAdmin); await Fixture.DeleteStream(stream, TestCredentials.TestAdmin); } diff --git a/test/EventStore.Client.Streams.Tests/Security/subscribe_to_all_security.cs b/test/EventStore.Client.Streams.Tests/Security/subscribe_to_all_security.cs index c9964c862..48b62a52d 100644 --- a/test/EventStore.Client.Streams.Tests/Security/subscribe_to_all_security.cs +++ b/test/EventStore.Client.Streams.Tests/Security/subscribe_to_all_security.cs @@ -4,18 +4,18 @@ namespace EventStore.Client.Streams.Tests; public class subscribe_to_all_security(ITestOutputHelper output, SecurityFixture fixture) : EventStoreTests(output, fixture) { [Fact] public async Task subscribing_to_all_with_not_existing_credentials_is_not_authenticated() => - await Assert.ThrowsAsync(() => Fixture.SubscribeToAllObsolete(TestCredentials.TestBadUser)); + await Assert.ThrowsAsync(() => Fixture.SubscribeToAll(TestCredentials.TestBadUser)); [Fact] - public async Task subscribing_to_all_with_no_credentials_is_denied() => await Assert.ThrowsAsync(() => Fixture.SubscribeToAllObsolete()); + public async Task subscribing_to_all_with_no_credentials_is_denied() => await Assert.ThrowsAsync(() => Fixture.SubscribeToAll()); [Fact] public async Task subscribing_to_all_with_not_authorized_user_credentials_is_denied() => - await Assert.ThrowsAsync(() => Fixture.SubscribeToAllObsolete(TestCredentials.TestUser2)); + await Assert.ThrowsAsync(() => Fixture.SubscribeToAll(TestCredentials.TestUser2)); [Fact] - public async Task subscribing_to_all_with_authorized_user_credentials_succeeds() => await Fixture.SubscribeToAllObsolete(TestCredentials.TestUser1); + public async Task subscribing_to_all_with_authorized_user_credentials_succeeds() => await Fixture.SubscribeToAll(TestCredentials.TestUser1); [Fact] - public async Task subscribing_to_all_with_admin_user_credentials_succeeds() => await Fixture.SubscribeToAllObsolete(TestCredentials.TestAdmin); + public async Task subscribing_to_all_with_admin_user_credentials_succeeds() => await Fixture.SubscribeToAll(TestCredentials.TestAdmin); } \ No newline at end of file diff --git a/test/EventStore.Client.Streams.Tests/Security/subscribe_to_stream_security.cs b/test/EventStore.Client.Streams.Tests/Security/subscribe_to_stream_security.cs index 64e459733..0af3f8da9 100644 --- a/test/EventStore.Client.Streams.Tests/Security/subscribe_to_stream_security.cs +++ b/test/EventStore.Client.Streams.Tests/Security/subscribe_to_stream_security.cs @@ -1,7 +1,6 @@ namespace EventStore.Client.Streams.Tests; [Trait("Category", "Security")] -[Obsolete] public class subscribe_to_stream_security(ITestOutputHelper output, SecurityFixture fixture) : EventStoreTests(output, fixture) { [Fact] diff --git a/test/EventStore.Client.Streams.Tests/Security/subscribe_to_stream_security_obsolete.cs b/test/EventStore.Client.Streams.Tests/Security/subscribe_to_stream_security_obsolete.cs deleted file mode 100644 index f5018d1c5..000000000 --- a/test/EventStore.Client.Streams.Tests/Security/subscribe_to_stream_security_obsolete.cs +++ /dev/null @@ -1,75 +0,0 @@ -namespace EventStore.Client.Streams.Tests; - -[Trait("Category", "Security")] -[Obsolete] -public class subscribe_to_stream_security_obsolete(ITestOutputHelper output, SecurityFixture fixture) : EventStoreTests(output, fixture) { - [Fact] - public async Task subscribing_to_stream_with_not_existing_credentials_is_not_authenticated() => - await Assert.ThrowsAsync(() => Fixture.SubscribeToStreamObsolete(SecurityFixture.ReadStream, TestCredentials.TestBadUser)); - - [Fact] - public async Task subscribing_to_stream_with_no_credentials_is_denied() => - await Assert.ThrowsAsync(() => Fixture.SubscribeToStreamObsolete(SecurityFixture.ReadStream)); - - [Fact] - public async Task subscribing_to_stream_with_not_authorized_user_credentials_is_denied() => - await Assert.ThrowsAsync(() => Fixture.SubscribeToStreamObsolete(SecurityFixture.ReadStream, TestCredentials.TestUser2)); - - [Fact] - public async Task reading_stream_with_authorized_user_credentials_succeeds() { - await Fixture.AppendStream(SecurityFixture.ReadStream, TestCredentials.TestUser1); - await Fixture.SubscribeToStreamObsolete(SecurityFixture.ReadStream, TestCredentials.TestUser1); - } - - [Fact] - public async Task reading_stream_with_admin_user_credentials_succeeds() { - await Fixture.AppendStream(SecurityFixture.ReadStream, TestCredentials.TestAdmin); - await Fixture.SubscribeToStreamObsolete(SecurityFixture.ReadStream, TestCredentials.TestAdmin); - } - - [AnonymousAccess.Fact] - public async Task subscribing_to_no_acl_stream_succeeds_when_no_credentials_are_passed() { - await Fixture.AppendStream(SecurityFixture.NoAclStream); - await Fixture.SubscribeToStreamObsolete(SecurityFixture.NoAclStream); - } - - [Fact] - public async Task subscribing_to_no_acl_stream_is_not_authenticated_when_not_existing_credentials_are_passed() => - await Assert.ThrowsAsync(() => Fixture.SubscribeToStreamObsolete(SecurityFixture.NoAclStream, TestCredentials.TestBadUser)); - - [Fact] - public async Task subscribing_to_no_acl_stream_succeeds_when_any_existing_user_credentials_are_passed() { - await Fixture.AppendStream(SecurityFixture.NoAclStream, TestCredentials.TestUser1); - await Fixture.SubscribeToStreamObsolete(SecurityFixture.NoAclStream, TestCredentials.TestUser1); - await Fixture.SubscribeToStreamObsolete(SecurityFixture.NoAclStream, TestCredentials.TestUser2); - } - - [Fact] - public async Task subscribing_to_no_acl_stream_succeeds_when_admin_user_credentials_are_passed() { - await Fixture.AppendStream(SecurityFixture.NoAclStream, TestCredentials.TestAdmin); - await Fixture.SubscribeToStreamObsolete(SecurityFixture.NoAclStream, TestCredentials.TestAdmin); - } - - [AnonymousAccess.Fact] - public async Task subscribing_to_all_access_normal_stream_succeeds_when_no_credentials_are_passed() { - await Fixture.AppendStream(SecurityFixture.NormalAllStream); - await Fixture.SubscribeToStreamObsolete(SecurityFixture.NormalAllStream); - } - - [Fact] - public async Task subscribing_to_all_access_normal_stream_is_not_authenticated_when_not_existing_credentials_are_passed() => - await Assert.ThrowsAsync(() => Fixture.SubscribeToStreamObsolete(SecurityFixture.NormalAllStream, TestCredentials.TestBadUser)); - - [Fact] - public async Task subscribing_to_all_access_normal_stream_succeeds_when_any_existing_user_credentials_are_passed() { - await Fixture.AppendStream(SecurityFixture.NormalAllStream, TestCredentials.TestUser1); - await Fixture.SubscribeToStreamObsolete(SecurityFixture.NormalAllStream, TestCredentials.TestUser1); - await Fixture.SubscribeToStreamObsolete(SecurityFixture.NormalAllStream, TestCredentials.TestUser2); - } - - [Fact] - public async Task subscribing_to_all_access_normal_streamm_succeeds_when_admin_user_credentials_are_passed() { - await Fixture.AppendStream(SecurityFixture.NormalAllStream, TestCredentials.TestAdmin); - await Fixture.SubscribeToStreamObsolete(SecurityFixture.NormalAllStream, TestCredentials.TestAdmin); - } -} diff --git a/test/EventStore.Client.Streams.Tests/Security/system_stream_security.cs b/test/EventStore.Client.Streams.Tests/Security/system_stream_security.cs index 66558ab91..c4e001b4a 100644 --- a/test/EventStore.Client.Streams.Tests/Security/system_stream_security.cs +++ b/test/EventStore.Client.Streams.Tests/Security/system_stream_security.cs @@ -15,7 +15,6 @@ public async Task operations_on_system_stream_with_no_acl_set_fail_for_non_admin await Assert.ThrowsAsync(() => Fixture.WriteMeta("$system-no-acl", TestCredentials.TestUser1)); await Assert.ThrowsAsync(() => Fixture.SubscribeToStream("$system-no-acl", TestCredentials.TestUser1)); - await Assert.ThrowsAsync(() => Fixture.SubscribeToStreamObsolete("$system-no-acl", TestCredentials.TestUser1)); } [Fact] @@ -30,7 +29,6 @@ public async Task operations_on_system_stream_with_no_acl_set_succeed_for_admin( await Fixture.WriteMeta("$system-no-acl", TestCredentials.TestAdmin); await Fixture.SubscribeToStream("$system-no-acl", TestCredentials.TestAdmin); - await Fixture.SubscribeToStreamObsolete("$system-no-acl", TestCredentials.TestAdmin); } [Fact] @@ -45,7 +43,6 @@ public async Task operations_on_system_stream_with_acl_set_to_usual_user_fail_fo await Assert.ThrowsAsync(() => Fixture.WriteMeta(SecurityFixture.SystemAclStream, TestCredentials.TestUser2, TestCredentials.TestUser1.Username)); await Assert.ThrowsAsync(() => Fixture.SubscribeToStream(SecurityFixture.SystemAclStream, TestCredentials.TestUser2)); - await Assert.ThrowsAsync(() => Fixture.SubscribeToStreamObsolete(SecurityFixture.SystemAclStream, TestCredentials.TestUser2)); } [Fact] @@ -59,7 +56,6 @@ public async Task operations_on_system_stream_with_acl_set_to_usual_user_succeed await Fixture.WriteMeta(SecurityFixture.SystemAclStream, TestCredentials.TestUser1, TestCredentials.TestUser1.Username); await Fixture.SubscribeToStream(SecurityFixture.SystemAclStream, TestCredentials.TestUser1); - await Fixture.SubscribeToStreamObsolete(SecurityFixture.SystemAclStream, TestCredentials.TestUser1); } [Fact] @@ -73,7 +69,6 @@ public async Task operations_on_system_stream_with_acl_set_to_usual_user_succeed await Fixture.WriteMeta(SecurityFixture.SystemAclStream, TestCredentials.TestAdmin, TestCredentials.TestUser1.Username); await Fixture.SubscribeToStream(SecurityFixture.SystemAclStream, TestCredentials.TestAdmin); - await Fixture.SubscribeToStreamObsolete(SecurityFixture.SystemAclStream, TestCredentials.TestAdmin); } [Fact] @@ -94,7 +89,6 @@ await Assert.ThrowsAsync( ); await Assert.ThrowsAsync(() => Fixture.SubscribeToStream(SecurityFixture.SystemAdminStream, TestCredentials.TestUser1)); - await Assert.ThrowsAsync(() => Fixture.SubscribeToStreamObsolete(SecurityFixture.SystemAdminStream, TestCredentials.TestUser1)); } [Fact] @@ -108,7 +102,6 @@ public async Task operations_on_system_stream_with_acl_set_to_admins_succeed_for await Fixture.WriteMeta(SecurityFixture.SystemAdminStream, TestCredentials.TestAdmin, SystemRoles.Admins); await Fixture.SubscribeToStream(SecurityFixture.SystemAdminStream, TestCredentials.TestAdmin); - await Fixture.SubscribeToStreamObsolete(SecurityFixture.SystemAdminStream, TestCredentials.TestAdmin); } [AnonymousAccess.Fact] @@ -122,7 +115,6 @@ public async Task operations_on_system_stream_with_acl_set_to_all_succeed_for_no await Fixture.WriteMeta(SecurityFixture.SystemAllStream, role: SystemRoles.All); await Fixture.SubscribeToStream(SecurityFixture.SystemAllStream); - await Fixture.SubscribeToStreamObsolete(SecurityFixture.SystemAllStream); } [Fact] @@ -136,7 +128,6 @@ public async Task operations_on_system_stream_with_acl_set_to_all_succeed_for_us await Fixture.WriteMeta(SecurityFixture.SystemAllStream, TestCredentials.TestUser1, SystemRoles.All); await Fixture.SubscribeToStream(SecurityFixture.SystemAllStream, TestCredentials.TestUser1); - await Fixture.SubscribeToStreamObsolete(SecurityFixture.SystemAllStream, TestCredentials.TestUser1); } [Fact] @@ -150,6 +141,5 @@ public async Task operations_on_system_stream_with_acl_set_to_all_succeed_for_ad await Fixture.WriteMeta(SecurityFixture.SystemAllStream, TestCredentials.TestAdmin, SystemRoles.All); await Fixture.SubscribeToStream(SecurityFixture.SystemAllStream, TestCredentials.TestAdmin); - await Fixture.SubscribeToStreamObsolete(SecurityFixture.SystemAllStream, TestCredentials.TestAdmin); } } diff --git a/test/EventStore.Client.Streams.Tests/Subscriptions/subscribe_to_all_obsolete.cs b/test/EventStore.Client.Streams.Tests/Subscriptions/Obsolete/subscribe_to_all_obsolete.cs similarity index 99% rename from test/EventStore.Client.Streams.Tests/Subscriptions/subscribe_to_all_obsolete.cs rename to test/EventStore.Client.Streams.Tests/Subscriptions/Obsolete/subscribe_to_all_obsolete.cs index d64e28c59..af4b5ac43 100644 --- a/test/EventStore.Client.Streams.Tests/Subscriptions/subscribe_to_all_obsolete.cs +++ b/test/EventStore.Client.Streams.Tests/Subscriptions/Obsolete/subscribe_to_all_obsolete.cs @@ -1,8 +1,8 @@ -namespace EventStore.Client.Streams.Tests.Subscriptions; +namespace EventStore.Client.Streams.Tests.Subscriptions.Obsolete; [Trait("Category", "Subscriptions")] [Trait("Category", "Target:All")] -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class subscribe_to_all_obsolete(ITestOutputHelper output, SubscriptionsFixture fixture) : EventStoreTests(output, fixture) { [Fact] public async Task receives_all_events_from_start() { diff --git a/test/EventStore.Client.Streams.Tests/Subscriptions/subscribe_to_stream_obsolete.cs b/test/EventStore.Client.Streams.Tests/Subscriptions/Obsolete/subscribe_to_stream_obsolete.cs similarity index 98% rename from test/EventStore.Client.Streams.Tests/Subscriptions/subscribe_to_stream_obsolete.cs rename to test/EventStore.Client.Streams.Tests/Subscriptions/Obsolete/subscribe_to_stream_obsolete.cs index 734da73fd..4e05b293b 100644 --- a/test/EventStore.Client.Streams.Tests/Subscriptions/subscribe_to_stream_obsolete.cs +++ b/test/EventStore.Client.Streams.Tests/Subscriptions/Obsolete/subscribe_to_stream_obsolete.cs @@ -1,8 +1,8 @@ -namespace EventStore.Client.Streams.Tests.Subscriptions; +namespace EventStore.Client.Streams.Tests.Subscriptions.Obsolete; [Trait("Category", "Subscriptions")] [Trait("Category", "Target:Stream")] -[Obsolete] +[Obsolete("Will be removed in future release when older subscriptions APIs are removed from the client")] public class subscribe_to_stream_obsolete(ITestOutputHelper output, SubscriptionsFixture fixture) : EventStoreTests(output, fixture) { [Fact] public async Task receives_all_events_from_start() {