示例#1
0
        public async Task Should_be_able_to_create_parameter()
        {
            await managementClient.CreateParameterAsync(new Parameter
            {
                Component = "federation-upstream",
                Name      = "myfakefederationupstream1",
                Vhost     = vhostName,
                Value     = new { value = new { uri = $"amqp://{username}:{password}@{rabbitHostName}" } }
            }).ConfigureAwait(false);

            Assert.Contains(await managementClient.GetParametersAsync().ConfigureAwait(false),
                            p => p.Name == "myfakefederationupstream1");
        }
        /// <summary>
        ///     Get all parameters on the cluster
        /// </summary>
        /// <param name="source"></param>
        /// <param name="cancellationToken"></param>
        public static IReadOnlyList <Parameter> GetParameters(
            [NotNull] this IManagementClient source,
            CancellationToken cancellationToken = default
            )
        {
            if (source == null)
            {
                throw new ArgumentNullException(nameof(source));
            }

            return(source.GetParametersAsync(cancellationToken)
                   .GetAwaiter()
                   .GetResult());
        }
示例#3
0
        public async Task Should_be_able_to_list_parameters()
        {
            var parameters = await managementClient.GetParametersAsync().ConfigureAwait(false);

            Assert.NotNull(parameters);
        }