// Copyright 2025 The NATS Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Mirrors server/jetstream_cluster_2_test.go in the NATS server Go source.
// ALL tests in this file are deferred: they require a running JetStream cluster.

namespace ZB.MOM.NatsNet.Server.IntegrationTests.JetStream;

/// <summary>
/// Integration tests for JetStream cluster — consumer replication, failover, and recovery.
/// Mirrors server/jetstream_cluster_2_test.go.
/// All tests are deferred pending JetStream cluster server infrastructure.
/// </summary>
public sealed class JetStreamCluster2Tests
{
    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void JsApiImport_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void MultiRestartBug_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void ServerLimits_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void AccountLoadFailure_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void AckPendingWithExpired_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void AckPendingWithMaxRedelivered_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void MixedMode_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void LeafnodeSpokes_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void LeafNodeDenyNoDupe_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void SingleLeafNodeWithoutSharedSystemAccount_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void Domains_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void DomainsWithNoJsHub_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void DomainsAndApiResponses_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void DomainsAndSameNameSources_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void SingleLeafNodeEnablingJetStream_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void LeafNodesWithoutJs_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void LeafNodesWithSameDomainNames_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void LeafDifferentAccounts_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void StreamInfoDeletedDetails_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void MirrorAndSourceExpiration_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void MirrorAndSourceSubLeaks_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void CreateConcurrentDurableConsumers_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void UpdateStreamToExisting_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void CrossAccountInterop_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void MsgIdDuplicateBug_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void NilMsgWithHeaderThroughSourcedStream_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void VarzReporting_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void PurgeBySequence_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void MaxConsumers_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void MaxConsumersMultipleConcurrentRequests_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void AccountMaxStreamsAndConsumersMultipleConcurrentRequests_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void PanicDecodingConsumerState_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void PullConsumerLeakedSubs_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void PushConsumerQueueGroup_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void ConsumerLastActiveReporting_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void RaceOnRaftCreate_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void DeadlockOnVarz_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void StreamCatchupNoState_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void LargeHeaders_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void FlowControlRequiresHeartbeats_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void MixedModeColdStartPrune_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void MirrorAndSourceCrossNonNeighboringDomain_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void Seal_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void StreamCreateIdempotent_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void RollupsRequirePurge_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void Rollups_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void RollupSubjectAndWatchers_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void AppendOnly_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void StreamUpdateSyncBug_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void KvMultipleConcurrentCreate_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void AccountInfoForSystemAccount_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void ListFilter_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void ConsumerUpdates_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void ConsumerMaxDeliverUpdate_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void AccountReservations_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void ConcurrentAccountLimits_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void BalancedPlacement_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void ConsumerPendingBug_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void PullPerf_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void PullConsumerLeaderChange_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void EphemeralPullConsumerServerShutdown_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void NakBackoffs_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void RedeliverBackoffs_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void ConsumerUpgrade_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void AddConsumerWithInfo_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void StreamReplicaUpdates_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void StreamAndConsumerScaleUpAndDown_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void InterestRetentionWithFilteredConsumersExtra_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void StreamConsumersCount_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void FilteredAndIdleConsumerNrgGrowth_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void MirrorOrSourceNotActiveReporting_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void StreamAdvisories_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void DuplicateRoutesDisruptJetStreamMetaGroup_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void DuplicateMsgIdsOnCatchupAndLeaderTakeover_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void ConsumerLeaderChangeDeadlock_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void MemoryConsumerCompactVsSnapshot_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void MemoryConsumerInterestRetention_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void DeleteAndRestoreAndRestart_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void MirrorSourceLoop_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void MirrorDeDupWindow_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void NewHealthz_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void ConsumerOverrides_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void StreamRepublish_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void ConsumerDeliverNewNotConsumingBeforeStepDownOrRestart_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void ConsumerDeliverNewMaxRedeliveriesAndServerRestart_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void NoRestartAdvisories_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void R1StreamPlacementNoReservation_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void ConsumerAndStreamNamesWithPathSeparators_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void FilteredMirrors_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void SameClusterLeafNodes_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void LeafNodeSpofMigrateLeaders_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void LeafNodeSpofMigrateLeadersWithMigrateDelay_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void StreamCatchupWithTruncateAndPriorSnapshot_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void NoOrphanedDueToNoConnection_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void StreamResetOnExpirationDuringPeerDownAndRestartWithLeaderChange_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void PullConsumerMaxWaiting_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void EncryptedDoubleSnapshotBug_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void RePublishUpdateSupported_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void DirectGetFromLeafnode_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void UnknownReplicaOnClusterRestart_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void SnapshotBeforePurgeAndCatchup_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void StreamResetWithLargeFirstSeq_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void StreamCatchupInteriorNilMsgs_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void LeaderAbortsCatchupOnFollowerError_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void StreamDirectGetNotTooSoon_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void StaleReadsOnRestart_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void ReplicasChangeStreamInfo_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void MaxOutstandingCatchup_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void CompressedStreamMessages_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void WorkQueueLosingMessagesOnConsumerDelete_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void R1ConsumerAdvisory_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void MessageTtlCatchup_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void ConsumerRedeliveryAfterUnexpectedReplicatedAck_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void ConsumerResetStartingSequenceToAgreedState_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void SubjectDeleteMarkers_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void SubjectDeleteMarkerClusteredProposal_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void SubjectDeleteMarkersTtlRollupWithMaxAge_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void SubjectDeleteMarkersTtlRollupWithoutMaxAge_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void SubjectDeleteMarkersTimingWithMaxAge_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void DesyncAfterFailedScaleUp_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void ScaleUpWithQuorum_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void DesyncAfterDiskResetOne_ShouldSucceed() { }

    [Fact(Skip = "deferred: requires running JetStream cluster")]
    public void DesyncAfterDiskResetAllButOne_ShouldSucceed() { }
}
