Unfortunately I don't have an easy suggestion here. Mocking all the
needed endpoints does seem like a lot of work; you could get away with
bringing up a web server and using a mocked HTTP handler, but that
will probably be a lot of work too. Or maybe have a test CM backed by
a test database that you clean up before running the tests (similar to
your "pre-deployed image" approach).
What we've done internally in the few cases where we use the Java
client without the complete server to back it up is to wrap the API
calls in a helper class; that class encapsulate the API calls needed
to execute a specific task in coarser methods, and those are much
easier to mock during tests. It's not perfect but it makes some amount
of testing possible.
Hope that helps.
On Fri, Jan 31, 2014 at 9:25 AM, email@example.com
So we created a project that uses the cloudera manager Java API to automate
our cluster deployments. Thought of throwing this out there to get some
thoughts on how to unit test the project.
A couple of ideas I had were:
1. Create a mock service and mock all the rest endpoints on the service that
are getting called. This seems feasible but too tedious and unit tests have
2. Use up a vagrant image with pre-deployed cloudera manager that the unit
tests can hit. This seems like an OK approach but very slow and prone to
If I haven't missed it, there is not a similar testing utility like
HBaseTestingUtility to spin up a local instance for testing correct? Any
other ideas on this would be highly appreciated.
To unsubscribe from this group and stop receiving emails from it, send an
email to firstname.lastname@example.org.
To unsubscribe from this group and stop receiving emails from it, send an email to email@example.com.