perwendel / spark

A simple expressive web framework for java. Spark has a kotlin DSL https://github.com/perwendel/spark-kotlin
Apache License 2.0
9.63k stars 1.56k forks source link

Test cases would be easier with a little more public API #1012

Open mschrag opened 6 years ago

mschrag commented 6 years ago

If Spark.getInstance() was public you could pass a Service into your route initializer. At runtime, that could be the shared Spark.getInstance, and in a test, that could be a custom instance. Likewise, if Service had a getRoutes() method, you could lookup a Route in a test case, and call .handle(..) on it directly.