예제 #1
0
        public void ThreadDumpEndpointMiddleware_PathAndVerbMatching_ReturnsExpected()
        {
            var actOptions = new ActuatorManagementOptions()
            {
                Path     = "/",
                Exposure = new Exposure {
                    Include = new List <string> {
                        "*"
                    }
                }
            };

            var opts = new ThreadDumpEndpointOptions();

            actOptions.EndpointOptions.Add(opts);
            ThreadDumper obs    = new ThreadDumper(opts);
            var          ep     = new ThreadDumpEndpoint(opts, obs);
            var          middle = new ThreadDumpEndpointMiddleware(null, ep, new List <IManagementOptions> {
                actOptions
            });

            Assert.True(middle.RequestVerbAndPathMatch("GET", "/dump"));
            Assert.False(middle.RequestVerbAndPathMatch("PUT", "/dump"));
            Assert.False(middle.RequestVerbAndPathMatch("GET", "/badpath"));
        }
예제 #2
0
        public void ThreadDumpEndpointMiddleware_PathAndVerbMatching_ReturnsExpected()
        {
            var          opts   = new ThreadDumpOptions();
            ThreadDumper obs    = new ThreadDumper(opts);
            var          ep     = new ThreadDumpEndpoint(opts, obs);
            var          middle = new ThreadDumpEndpointMiddleware(null, ep);

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