CLOUDIFY-2164 Added validations and tests.