https://clojars.org/column/lein-template https://gitlab.com/demonshreder/column A leiningen template based on pedestal
Hi y’all, what is the best practice for altering the list of middlewares when unit testing with response-for
? I need to do things like disabling authentication and rate limiting
I have my authentication interceptors depend on resources that are mocked out via test fixtures
so if I want to run tests in a namespace where authentication is “disabled” I can use that fixture
also building up interceptor chains and testing them with chain/execute was recommended a few days ago to test those interceptor (sub)chains
@jonathan617, another alternative is to assoc dependencies to the service map and refer to them during service initialization when building the interceptor chain. A good example of this is found with Pedestal’s io.pedestal.http/default-interceptors
implementation (https://github.com/pedestal/pedestal/blob/master/service/src/io/pedestal/http.clj#L182). This way you can swap out the impls to use depending on your needs.
Thanks guys 🙂