As the REST API is a part of the core, it is more appropriate for the tests to reside there as well. Further refactoring of the testing needs to be done to allow multiple components to use the same framework but with different tests.