AMBARI-5474. Unit tests for steps 3-4. (onechiporenko)