Fixed the test controller to generate proper test controller code when the MVC endpoints publish events.