RequestImpl implements Request { @Override public Set<String> getPropertyIds() { return propertyIds; } RequestImpl(Set<String> propertyIds, Set<Map<String, Object>> properties,
                     Map<String, String> requestInfoProperties, Map<String,TemporalInfo> mapTemporalInfo);  RequestImpl(Set<String> propertyIds, Set<Map<String, Object>> properties,
                     Map<String, String> requestInfoProperties, Map<String, TemporalInfo> mapTemporalInfo,
                     SortRequest sortRequest, PageRequest pageRequest); @Override Set<String> getPropertyIds(); @Override Set<Map<String, Object>> getProperties(); @Override Map<String, String> getRequestInfoProperties(); @Override TemporalInfo getTemporalInfo(String id); @Override PageRequest getPageRequest(); @Override SortRequest getSortRequest(); @Override boolean isDryRunRequest(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void testGetPropertyIds() { Request request = PropertyHelper.getReadRequest(propertyIds); Assert.assertEquals(propertyIds, request.getPropertyIds()); }
@Test public void testValidPropertyIds() { Request request = PropertyHelper.getReadRequest(PropertyHelper.getPropertyIds(Resource.Type.HostComponent)); Set<String> validPropertyIds = request.getPropertyIds(); Assert.assertFalse(validPropertyIds.contains("HostRoles/unsupported_property_id")); Assert.assertTrue(validPropertyIds.contains("params/run_smoke_test")); Assert.assertTrue(validPropertyIds.contains("HostRoles/actual_configs")); Assert.assertTrue(validPropertyIds.contains("HostRoles/desired_stack_id")); Assert.assertTrue(validPropertyIds.contains("HostRoles/stack_id")); Assert.assertTrue(validPropertyIds.contains("HostRoles/desired_state")); Assert.assertTrue(validPropertyIds.contains("HostRoles/state")); Assert.assertTrue(validPropertyIds.contains("HostRoles/component_name")); Assert.assertTrue(validPropertyIds.contains("HostRoles/host_name")); Assert.assertTrue(validPropertyIds.contains("HostRoles/cluster_name")); Assert.assertTrue(validPropertyIds.contains("HostRoles/role_id")); request = PropertyHelper.getReadRequest(PropertyHelper.getPropertyIds(Resource.Type.Cluster)); validPropertyIds = request.getPropertyIds(); Assert.assertFalse(validPropertyIds.contains("Clusters/unsupported_property_id")); Assert.assertTrue(validPropertyIds.contains("Clusters/cluster_id")); Assert.assertTrue(validPropertyIds.contains("Clusters/cluster_name")); Assert.assertTrue(validPropertyIds.contains("Clusters/version")); Assert.assertTrue(validPropertyIds.contains("Clusters/state")); Assert.assertTrue(validPropertyIds.contains("Clusters/desired_configs")); request = PropertyHelper.getReadRequest(PropertyHelper.getPropertyIds(Resource.Type.Service)); validPropertyIds = request.getPropertyIds(); Assert.assertFalse(validPropertyIds.contains("ServiceInfo/unsupported_property_id")); Assert.assertTrue(validPropertyIds.contains("ServiceInfo/service_name")); Assert.assertTrue(validPropertyIds.contains("ServiceInfo/cluster_name")); Assert.assertTrue(validPropertyIds.contains("ServiceInfo/state")); Assert.assertTrue(validPropertyIds.contains("Services/description")); Assert.assertTrue(validPropertyIds.contains("Services/display_name")); Assert.assertTrue(validPropertyIds.contains("Services/attributes")); Assert.assertTrue(validPropertyIds.contains("params/run_smoke_test")); Assert.assertTrue(validPropertyIds.contains("params/reconfigure_client")); request = PropertyHelper.getReadRequest(PropertyHelper.getPropertyIds(Resource.Type.Host)); validPropertyIds = request.getPropertyIds(); Assert.assertFalse(validPropertyIds.contains("Hosts/unsupported_property_id")); Assert.assertTrue(validPropertyIds.contains("Hosts/cluster_name")); Assert.assertTrue(validPropertyIds.contains("Hosts/host_name")); Assert.assertTrue(validPropertyIds.contains("Hosts/ip")); Assert.assertTrue(validPropertyIds.contains("Hosts/attributes")); Assert.assertTrue(validPropertyIds.contains("Hosts/total_mem")); Assert.assertTrue(validPropertyIds.contains("Hosts/cpu_count")); Assert.assertTrue(validPropertyIds.contains("Hosts/ph_cpu_count")); Assert.assertTrue(validPropertyIds.contains("Hosts/os_arch")); Assert.assertTrue(validPropertyIds.contains("Hosts/os_type")); Assert.assertTrue(validPropertyIds.contains("Hosts/rack_info")); Assert.assertTrue(validPropertyIds.contains("Hosts/last_heartbeat_time")); Assert.assertTrue(validPropertyIds.contains("Hosts/last_agent_env")); Assert.assertTrue(validPropertyIds.contains("Hosts/last_registration_time")); Assert.assertTrue(validPropertyIds.contains("Hosts/disk_info")); Assert.assertTrue(validPropertyIds.contains("Hosts/host_status")); Assert.assertTrue(validPropertyIds.contains("Hosts/host_health_report")); Assert.assertTrue(validPropertyIds.contains("Hosts/public_host_name")); Assert.assertTrue(validPropertyIds.contains("Hosts/host_state")); Assert.assertTrue(validPropertyIds.contains("Hosts/desired_configs")); request = PropertyHelper.getReadRequest(PropertyHelper.getPropertyIds(Resource.Type.Component)); validPropertyIds = request.getPropertyIds(); Assert.assertFalse(validPropertyIds.contains("ServiceComponentInfo/unsupported_property_id")); Assert.assertTrue(validPropertyIds.contains("ServiceComponentInfo/service_name")); Assert.assertTrue(validPropertyIds.contains("ServiceComponentInfo/component_name")); Assert.assertTrue(validPropertyIds.contains("ServiceComponentInfo/cluster_name")); Assert.assertTrue(validPropertyIds.contains("ServiceComponentInfo/state")); Assert.assertTrue(validPropertyIds.contains("ServiceComponents/display_name")); Assert.assertTrue(validPropertyIds.contains("ServiceComponents/description")); Assert.assertTrue(validPropertyIds.contains("params/run_smoke_test")); request = PropertyHelper.getReadRequest(PropertyHelper.getPropertyIds(Resource.Type.Action)); validPropertyIds = request.getPropertyIds(); Assert.assertFalse(validPropertyIds.contains("Action/unsupported_property_id")); Assert.assertTrue(validPropertyIds.contains("Actions/action_name")); Assert.assertTrue(validPropertyIds.contains("Actions/action_type")); Assert.assertTrue(validPropertyIds.contains("Actions/inputs")); Assert.assertTrue(validPropertyIds.contains("Actions/target_service")); Assert.assertTrue(validPropertyIds.contains("Actions/target_component")); Assert.assertTrue(validPropertyIds.contains("Actions/description")); Assert.assertTrue(validPropertyIds.contains("Actions/target_type")); Assert.assertTrue(validPropertyIds.contains("Actions/default_timeout")); request = PropertyHelper.getReadRequest(PropertyHelper.getPropertyIds(Resource.Type.Request)); validPropertyIds = request.getPropertyIds(); Assert.assertFalse(validPropertyIds.contains("Requests/unsupported_property_id")); Assert.assertTrue(validPropertyIds.contains("Requests/id")); Assert.assertTrue(validPropertyIds.contains("Requests/cluster_name")); Assert.assertTrue(validPropertyIds.contains("Requests/request_status")); Assert.assertTrue(validPropertyIds.contains("Requests/request_context")); request = PropertyHelper.getReadRequest(PropertyHelper.getPropertyIds(Resource.Type.Task)); validPropertyIds = request.getPropertyIds(); Assert.assertFalse(validPropertyIds.contains("Task/unsupported_property_id")); Assert.assertTrue(validPropertyIds.contains("Tasks/id")); Assert.assertTrue(validPropertyIds.contains("Tasks/request_id")); Assert.assertTrue(validPropertyIds.contains("Tasks/cluster_name")); Assert.assertTrue(validPropertyIds.contains("Tasks/stage_id")); Assert.assertTrue(validPropertyIds.contains("Tasks/host_name")); Assert.assertTrue(validPropertyIds.contains("Tasks/command")); Assert.assertTrue(validPropertyIds.contains("Tasks/role")); Assert.assertTrue(validPropertyIds.contains("Tasks/status")); Assert.assertTrue(validPropertyIds.contains("Tasks/exit_code")); Assert.assertTrue(validPropertyIds.contains("Tasks/stderr")); Assert.assertTrue(validPropertyIds.contains("Tasks/stdout")); Assert.assertTrue(validPropertyIds.contains("Tasks/start_time")); Assert.assertTrue(validPropertyIds.contains("Tasks/attempt_cnt")); request = PropertyHelper.getReadRequest(PropertyHelper.getPropertyIds(Resource.Type.User)); validPropertyIds = request.getPropertyIds(); Assert.assertFalse(validPropertyIds.contains("Users/unsupported_property_id")); Assert.assertTrue(validPropertyIds.contains("Users/user_name")); Assert.assertTrue(validPropertyIds.contains("Users/password")); Assert.assertTrue(validPropertyIds.contains("Users/old_password")); Assert.assertTrue(validPropertyIds.contains("Users/ldap_user")); request = PropertyHelper.getReadRequest(PropertyHelper.getPropertyIds(Resource.Type.Stack)); validPropertyIds = request.getPropertyIds(); Assert.assertFalse(validPropertyIds.contains("Stacks/unsupported_property_id")); Assert.assertTrue(validPropertyIds.contains("Stacks/stack_name")); request = PropertyHelper.getReadRequest(PropertyHelper.getPropertyIds(Resource.Type.StackVersion)); validPropertyIds = request.getPropertyIds(); Assert.assertFalse(validPropertyIds.contains("Versions/unsupported_property_id")); Assert.assertTrue(validPropertyIds.contains("Versions/stack_name")); Assert.assertTrue(validPropertyIds.contains("Versions/stack_version")); Assert.assertTrue(validPropertyIds.contains("Versions/min_upgrade_version")); request = PropertyHelper.getReadRequest(OperatingSystemResourceProvider.propertyIds); validPropertyIds = request.getPropertyIds(); Assert.assertFalse(validPropertyIds.contains("OperatingSystems/unsupported_property_id")); Assert.assertTrue(validPropertyIds.contains("OperatingSystems/stack_name")); Assert.assertTrue(validPropertyIds.contains("OperatingSystems/stack_version")); Assert.assertTrue(validPropertyIds.contains("OperatingSystems/os_type")); request = PropertyHelper.getReadRequest(RepositoryResourceProvider.propertyIds); validPropertyIds = request.getPropertyIds(); Assert.assertFalse(validPropertyIds.contains("Repositories/unsupported_property_id")); Assert.assertTrue(validPropertyIds.contains("Repositories/stack_name")); Assert.assertTrue(validPropertyIds.contains("Repositories/stack_version")); Assert.assertTrue(validPropertyIds.contains("Repositories/os_type")); Assert.assertTrue(validPropertyIds.contains("Repositories/base_url")); Assert.assertTrue(validPropertyIds.contains("Repositories/repo_id")); Assert.assertTrue(validPropertyIds.contains("Repositories/repo_name")); Assert.assertTrue(validPropertyIds.contains("Repositories/mirrors_list")); request = PropertyHelper.getReadRequest(PropertyHelper.getPropertyIds(Resource.Type.StackService)); validPropertyIds = request.getPropertyIds(); Assert.assertFalse(validPropertyIds.contains("StackServices/unsupported_property_id")); Assert.assertTrue(validPropertyIds.contains("StackServices/stack_name")); Assert.assertTrue(validPropertyIds.contains("StackServices/stack_version")); Assert.assertTrue(validPropertyIds.contains("StackServices/service_name")); Assert.assertTrue(validPropertyIds.contains("StackServices/user_name")); Assert.assertTrue(validPropertyIds.contains("StackServices/comments")); Assert.assertTrue(validPropertyIds.contains("StackServices/service_version")); request = PropertyHelper.getReadRequest(PropertyHelper.getPropertyIds(Resource.Type.StackConfiguration)); validPropertyIds = request.getPropertyIds(); Assert.assertFalse(validPropertyIds.contains("StackConfigurations/unsupported_property_id")); Assert.assertTrue(validPropertyIds.contains("StackConfigurations/stack_name")); Assert.assertTrue(validPropertyIds.contains("StackConfigurations/stack_version")); Assert.assertTrue(validPropertyIds.contains("StackConfigurations/service_name")); Assert.assertTrue(validPropertyIds.contains("StackConfigurations/property_name")); Assert.assertTrue(validPropertyIds.contains("StackConfigurations/property_description")); Assert.assertTrue(validPropertyIds.contains("StackConfigurations/property_value")); request = PropertyHelper.getReadRequest(PropertyHelper.getPropertyIds(Resource.Type.StackServiceComponent)); validPropertyIds = request.getPropertyIds(); Assert.assertFalse(validPropertyIds.contains("StackServiceComponents/unsupported_property_id")); Assert.assertTrue(validPropertyIds.contains("StackServiceComponents/stack_version")); Assert.assertTrue(validPropertyIds.contains("StackServiceComponents/stack_name")); Assert.assertTrue(validPropertyIds.contains("StackServiceComponents/service_name")); Assert.assertTrue(validPropertyIds.contains("StackServiceComponents/component_name")); Assert.assertTrue(validPropertyIds.contains("StackServiceComponents/component_category")); Assert.assertTrue(validPropertyIds.contains("StackServiceComponents/is_master")); Assert.assertTrue(validPropertyIds.contains("StackServiceComponents/is_client")); }