public async Task GetClusterInfo_TryGetClusterInfo_SuccefullyGetClusterInfo()
        {
            _clusterManager.Setup(x => x.ClusterInfoAsync()).ReturnsAsync(_clusterInfoResult.Object);
            _clusterInfoResult.SetupGet(x => x.Success).Returns(true);
            _clusterInfoResult.SetupGet(x => x.Value).Returns(_clusterInfo.Object);

            IClusterInfo info = await _target.GetClusterInfoAsync();

            Assert.AreEqual(_clusterInfo.Object, info);
            _clusterManager.Verify(x => x.ClusterInfoAsync(), Times.Once);
        }
Beispiel #2
0
        public async Task <ICheckResult> RunAsync()
        {
            IClusterInfo clusterInfo;

            try
            {
                clusterInfo = await _clusterService.GetClusterInfoAsync();
            }
            catch (CannotAccesClusterInfoException ex)
            {
                return(new CheckResult(ShortName, NotificationLevel.Critical, ex.Message));
            }

            IEnumerable <string> bucketWarnings = GetBucketsToWarnOn(clusterInfo.BucketConfigs());

            return(ConvertToCheckResult(bucketWarnings));
        }