Or, run your tests against the service layer, as just another consumer and keep the controller code thin. Your tests now have no depedency on WebApplicationFramework or the like. Your public interface is not necessarily your HTTP API. It may be the service layer