Exemplo n.º 1
0
        public void HypermediaEndpointMiddleware_PathAndVerbMatching_ReturnsExpected()
        {
            var opts        = new HypermediaEndpointOptions();
            var mgmtOptions = TestHelpers.GetManagementOptions(opts);
            var ep          = new ActuatorEndpoint(opts, mgmtOptions);
            var middle      = new ActuatorHypermediaEndpointMiddleware(null, ep, mgmtOptions);

            Assert.True(middle.RequestVerbAndPathMatch("GET", "/actuator"));
            Assert.False(middle.RequestVerbAndPathMatch("PUT", "/actuator"));
            Assert.False(middle.RequestVerbAndPathMatch("GET", "/actuator/badpath"));
        }
Exemplo n.º 2
0
        public void ActuatoHypermediaEndpointMiddleware_PathAndVerbMatching_ReturnsExpected()
        {
            var opts     = new HypermediaEndpointOptions();
            var actmOpts = new ActuatorManagementOptions();
            var mgmtOpts = new List <IManagementOptions> {
                actmOpts
            };

            var ep = new ActuatorEndpoint(opts, mgmtOpts);

            actmOpts.EndpointOptions.Add(opts);
            var middle = new ActuatorHypermediaEndpointMiddleware(null, ep, mgmtOpts);

            Assert.True(middle.RequestVerbAndPathMatch("GET", "/actuator"));
            Assert.False(middle.RequestVerbAndPathMatch("PUT", "/actuator"));
            Assert.False(middle.RequestVerbAndPathMatch("GET", "/badpath"));
        }