anchor.diff:          catch throw:Error ->
               Error
           end
  -    end,
  +    end.
  +
  +
  +get_file_xattrs_on_provider_not_supporting_space_test(Config) ->
  +    get_xattrs_on_provider_not_supporting_space_test_base(<<"file">>, Config).
  +
  +
  +get_dir_xattrs_on_provider_not_supporting_space_test(Config) ->
  +    get_xattrs_on_provider_not_supporting_space_test_base(<<"dir">>, Config).
  +
  +
  +%% @private
  +get_xattrs_on_provider_not_supporting_space_test_base(FileType, Config) ->
  +    [P2, P1] = Providers = ?config(op_worker_nodes, Config),
  +    SessIdP1 = ?USER_IN_BOTH_SPACES_SESS_ID(P1, Config),
  +
  +    FilePath = filename:join(["/", ?SPACE_1, ?RANDOM_FILE_NAME]),
  +    {ok, FileGuid} = create_file(FileType, P1, SessIdP1, FilePath),
  +    ?assertMatch(ok, lfm_proxy:set_xattr(P1, SessIdP1, {guid, FileGuid}, ?XATTR_1)),
  +
  +    GetExpCallResultFun = fun(_TestCtx) -> {ok, #{?XATTR_1_KEY => ?XATTR_1_VALUE}} end,
   
       get_metadata_test_base(
  -        Config,
           <<"xattrs">>,
  -        GetExpectedResultFun,
  -        DataSpec,
  -        ShareId,
  -        [
  -            {
  -                <<"dir">>,
  -                DirWithoutMetadataPath, DirWithoutMetadataGuid,
  -                DirWithMetadataPath, DirWithMetadataGuid
  -            },
  -            {
  -                <<"file">>,
  -                RegularFileWithoutMetadataPath, RegularFileWithoutMetadataGuid,
  -                RegularFileWithMetadataPath, RegularFileWithMetadataGuid
  -            }
  -        ]
  +        FileType, FilePath, FileGuid, undefined,
  +        create_validate_get_metadata_rest_call_fun(GetExpCallResultFun, P2),
  +        create_validate_get_metadata_gs_call_fun(GetExpCallResultFun, P2),
  +        Providers,
  +        ?CLIENT_SPEC_FOR_SPACE_1_SCENARIOS(Config),
  +        _DataSpec = undefined,
  +        _QsParams = [],
  +        Config
       ).
   
   
  +%%%===================================================================
  +%%% Get metadata generic functions
  +%%%===================================================================
  +
  +
  +%% @private
  +create_validate_get_metadata_rest_call_fun(GetExpResultFun) ->
  +    create_validate_get_metadata_rest_call_fun(GetExpResultFun, undefined).
  +
  +
  +%% @private
  +create_validate_get_metadata_rest_call_fun(GetExpResultFun, ProviderNotSupportingSpace) ->
  +    fun
  +        (#api_test_ctx{node = TestNode}, {ok, RespCode, RespBody}) when TestNode == ProviderNotSupportingSpace ->
  +            ProviderDomain = ?GET_DOMAIN_BIN(ProviderNotSupportingSpace),
  +            ExpError = ?REST_ERROR(?ERROR_SPACE_NOT_SUPPORTED_BY(ProviderDomain)),
  +            ?assertEqual({?HTTP_400_BAD_REQUEST, ExpError}, {RespCode, RespBody});
  +        (TestCtx, {ok, RespCode, RespBody}) ->
  +            case GetExpResultFun(TestCtx) of
  +                {ok, ExpMetadata} ->
  +                    ?assertEqual({?HTTP_200_OK, ExpMetadata}, {RespCode, RespBody});
  +                {error, _} = Error ->
  +                    ExpRestError = {errors:to_http_code(Error), ?REST_ERROR(Error)},
  +                    ?assertEqual(ExpRestError, {RespCode, RespBody})
  +            end
  +    end.
  +
  +
  +%% @private
  +create_validate_get_metadata_gs_call_fun(GetExpResultFun) ->
  +    create_validate_get_metadata_gs_call_fun(GetExpResultFun, undefined).
  +
  +
  +%% @private
  +create_validate_get_metadata_gs_call_fun(GetExpResultFun, ProviderNotSupportingSpace) ->
  +    fun
  +        (#api_test_ctx{node = TestNode}, Result) when TestNode == ProviderNotSupportingSpace ->
  +            ProviderDomain = ?GET_DOMAIN_BIN(ProviderNotSupportingSpace),
  +            ExpError = ?ERROR_SPACE_NOT_SUPPORTED_BY(ProviderDomain),
  +            ?assertEqual(ExpError, Result);
  +        (TestCtx, Result) ->
  +            case GetExpResultFun(TestCtx) of
  +                {ok, ExpMetadata} ->
  +                    ?assertEqual({ok, #{<<"metadata">> => ExpMetadata}}, Result);
  +                {error, _} = ExpError ->
  +                    ?assertEqual(ExpError, Result)
  +            end
  +    end.
  +
  +
  +%% @private
   -spec get_metadata_test_base(
  -    Config :: proplists:proplist(),
       MetadataType :: binary(),  %% <<"json">> | <<"rdf">> | <<"xattrs">>
  -
  -    GetExpectedResultFun :: fun((api_test_ctx(), undefined | od_share:id(), DirectMetadataSet :: boolean()) -> ExpResult :: term()),
  -
  -    DataSpec :: data_spec(),
  -    ShareId :: od_share:id(),
  -    FilesInSpace2List :: [{
  -        FileType :: binary(), % <<"file">> | <<"dir">>
  -        FileWithoutMetadataPath :: binary(),
  -        FileWithoutMetadataGuid :: file_id:file_guid(),
  -        FileWithMetadataPath :: binary(),
  -        FileWithMetadataGuid :: file_id:file_guid()
  -    }]
  +    FileType :: binary(),      %% <<"dir">> | <<"file">>
  +    FilePath :: file_meta:path(),
  +    FileGuid :: file_id:file_guid(),
  +    ShareId :: undefined | od_share:id(),
  +    ValidateRestCallResultFun :: fun((api_test_ctx(), {ok, RespCode :: pos_integer(), RespBody :: term()}) -> ok),
  +    ValidateGsCallResultFun :: fun((api_test_ctx(), Result :: term()) -> ok),
  +    Providers :: [node()],
  +    client_spec(),
  +    data_spec(),
  +    QsParameters :: [binary()],
  +    Config :: proplists:proplist()
   ) ->
  -    ok | no_return().
  +    ok.
   get_metadata_test_base(
  -    Config,
  -    MetadataType,
  -
  -    GetExpectedResultFun,
  -
  -    DataSpec,
  -    ShareId,
  -    FilesInSpace2List
  +    MetadataType, FileType, FilePath, FileGuid, _ShareId = undefined,
  +    ValidateRestCallResultFun, ValidateGsCallResultFun,
  +    Providers, ClientSpec, DataSpec, QsParameters, Config
   ) ->
  -    [Provider2, Provider1] = Providers = ?config(op_worker_nodes, Config),
  -
  -    SupportedClientsPerNode = #{
  -        Provider1 => [?USER_IN_SPACE_1_AUTH, ?USER_IN_SPACE_2_AUTH, ?USER_IN_BOTH_SPACES_AUTH],
  -        Provider2 => [?USER_IN_SPACE_2_AUTH, ?USER_IN_BOTH_SPACES_AUTH]
  -    },
  -
  -    ClientSpecForGetJsonInSpace2Scenarios = #client_spec{
  -        correct = [?USER_IN_SPACE_2_AUTH, ?USER_IN_BOTH_SPACES_AUTH],
  -        unauthorized = [?NOBODY],
  -        forbidden = [?USER_IN_SPACE_1_AUTH],
  -        supported_clients_per_node = SupportedClientsPerNode
  -    },
  +    {ok, FileObjectId} = file_id:guid_to_objectid(FileGuid),
  +
  +    ?assert(api_test_utils:run_scenarios(Config, [
  +        #scenario_spec{
  +            name = <<"Get ", MetadataType/binary, " metadata from ", FileType/binary, " using rest endpoint">>,
  +            type = rest,
  +            target_nodes = Providers,
  +            client_spec = ClientSpec,
  +            prepare_args_fun = ?GET_METADATA_REST_ARGS_FUN(MetadataType, FileObjectId, QsParameters),
  +            validate_result_fun = ValidateRestCallResultFun,
  +            data_spec = DataSpec
  +        },
  +        #scenario_spec{
  +            name = <<"Get ", MetadataType/binary, " metadata from ", FileType/binary, " using deprecated path rest endpoint">>,
  +            type = rest_with_file_path,
  +            target_nodes = Providers,
  +            client_spec = ClientSpec,
  +            prepare_args_fun = ?GET_METADATA_DEPRECATED_PATH_REST_ARGS_FUN(MetadataType, FilePath, QsParameters),
  +            validate_result_fun = ValidateRestCallResultFun,
  +            data_spec = DataSpec
  +        },
  +        #scenario_spec{
  +            name = <<"Get ", MetadataType/binary, " metadata from ", FileType/binary, " using deprecated id rest endpoint">>,
  +            type = rest,
  +            target_nodes = Providers,
  +            client_spec = ClientSpec,
  +            prepare_args_fun = ?GET_METADATA_DEPRECATED_ID_REST_ARGS_FUN(MetadataType, FileObjectId, QsParameters),
  +            validate_result_fun = ValidateRestCallResultFun,
  +            data_spec = DataSpec
  +        },
  +        #scenario_spec{
  +            name = <<"Get ", MetadataType/binary, " metadata from ", FileType/binary, " using gs api">>,
  +            type = gs,
  +            target_nodes = Providers,
  +            client_spec = ClientSpec,
  +            prepare_args_fun = ?GET_METADATA_GS_ARGS_FUN(MetadataType, FileGuid, private),
  +            validate_result_fun = ValidateGsCallResultFun,
  +            data_spec = DataSpec
  +        }
  +    ]));
  +get_metadata_test_base(
  +    MetadataType, FileType, _FilePath, FileGuid, ShareId,
  +    ValidateRestCallResultFun, ValidateGsCallResultFun,
  +    Providers, _ClientSpec, DataSpec, QsParameters, Config
  +) ->
  +    FileShareGuid = file_id:guid_to_share_guid(FileGuid, ShareId),
  +    {ok, FileShareObjectId} = file_id:guid_to_objectid(FileShareGuid),
   
       % Special case -> any user can make requests for shares but if request is
       % being made using credentials by user not supported on specific provider
       % ?ERROR_USER_NOT_SUPPORTED will be returned
  -    ClientSpecForShareScenarios = #client_spec{
  +    ClientSpec = #client_spec{
           correct = [?NOBODY, ?USER_IN_SPACE_1_AUTH, ?USER_IN_SPACE_2_AUTH, ?USER_IN_BOTH_SPACES_AUTH],
           unauthorized = [],
           forbidden = [],
  -        supported_clients_per_node = SupportedClientsPerNode
  +        supported_clients_per_node = ?SUPPORTED_CLIENTS_PER_NODE(Config)
       },
  -
  -    QsParameters = case DataSpec of
  -        undefined ->
  -            [];
  -        #data_spec{optional = OptionalParams} ->
  -            OptionalParams
  -    end,
  -
  -    ConstructValidateSuccessfulRestResultFun = fun(ShareId, DirectMetadataSet) ->
  -        fun(TestCtx, {ok, RespCode, RespBody}) ->
  -            {ExpCode, ExpBody} = case GetExpectedResultFun(TestCtx, ShareId, DirectMetadataSet) of
  -                {ok, ExpResult} ->
  -                    {?HTTP_200_OK, ExpResult};
  -                {error, _} = ExpError ->
  -                    {errors:to_http_code(ExpError), ?REST_ERROR(ExpError)}
  -            end,
  -            ?assertEqual({ExpCode, ExpBody}, {RespCode, RespBody})
  -        end
  -    end,
  -    ConstructValidateSuccessfulGsResultFun = fun(ShareId, DirectMetadataSet) ->
  -        fun(TestCtx, Result) ->
  -            case GetExpectedResultFun(TestCtx, ShareId, DirectMetadataSet) of
  -                {ok, ExpResult} ->
  -                    ?assertEqual({ok, #{<<"metadata">> => ExpResult}}, Result);
  -                {error, _} = ExpError ->
  -                    ?assertEqual(ExpError, Result)
  -            end
  -        end
  -    end,
  -
  -    lists:foreach(fun({
  -        FileType,
  -        FileWithoutJsonMetadataPath, FileWithoutJsonMetadataGuid,
  -        FileWithJsonMetadataPath, FileWithJsonMetadataGuid
  -    }) ->
  -        {ok, FileWithoutJsonMetadataObjectId} = file_id:guid_to_objectid(FileWithoutJsonMetadataGuid),
  -        {ok, FileWithJsonMetadataObjectId} = file_id:guid_to_objectid(FileWithJsonMetadataGuid),
  -
  -        ShareGuid = file_id:guid_to_share_guid(FileWithJsonMetadataGuid, ShareId),
  -        {ok, ShareObjectId} = file_id:guid_to_objectid(ShareGuid),
  -
  -        ?assert(api_test_utils:run_scenarios(Config, [
  -
  -            %% TEST METADATA FOR FILE WITH METADATA SET
  -
  -            #scenario_spec{
  -                name = <<"Get ", MetadataType/binary, " metadata from ", FileType/binary, " with ", MetadataType/binary, " set using /data/ rest endpoint">>,
  -                type = rest,
  -                target_nodes = Providers,
  -                client_spec = ClientSpecForGetJsonInSpace2Scenarios,
  -                prepare_args_fun = ?GET_METADATA_REST_ARGS_FUN(MetadataType, FileWithJsonMetadataObjectId, QsParameters),
  -                validate_result_fun = ConstructValidateSuccessfulRestResultFun(undefined, true),
  -                data_spec = DataSpec
  -            },
  -            #scenario_spec{
  -                name = <<"Get ", MetadataType/binary, " metadata from ", FileType/binary, " with ", MetadataType/binary, " set using /files/ rest endpoint">>,
  -                type = rest_with_file_path,
  -                target_nodes = Providers,
  -                client_spec = ClientSpecForGetJsonInSpace2Scenarios,
  -                prepare_args_fun = ?GET_METADATA_DEPRECATED_PATH_REST_ARGS_FUN(MetadataType, FileWithJsonMetadataPath, QsParameters),
  -                validate_result_fun = ConstructValidateSuccessfulRestResultFun(undefined, true),
  -                data_spec = DataSpec
  -            },
  -            #scenario_spec{
  -                name = <<"Get ", MetadataType/binary, " metadata from ", FileType/binary, " with ", MetadataType/binary, " set using /files-id/ rest endpoint">>,
  -                type = rest,
  -                target_nodes = Providers,
  -                client_spec = ClientSpecForGetJsonInSpace2Scenarios,
  -                prepare_args_fun = ?GET_METADATA_DEPRECATED_ID_REST_ARGS_FUN(MetadataType, FileWithJsonMetadataObjectId, QsParameters),
  -                validate_result_fun = ConstructValidateSuccessfulRestResultFun(undefined, true),
  -                data_spec = DataSpec
  -            },
  -            #scenario_spec{
  -                name = <<"Get ", MetadataType/binary, " metadata from ", FileType/binary, " with ", MetadataType/binary, " set using gs api">>,
  -                type = gs,
  -                target_nodes = Providers,
  -                client_spec = ClientSpecForGetJsonInSpace2Scenarios,
  -                prepare_args_fun = ?GET_METADATA_GS_ARGS_FUN(MetadataType, FileWithJsonMetadataGuid, private),
  -                validate_result_fun = ConstructValidateSuccessfulGsResultFun(undefined, true),
  -                data_spec = DataSpec
  -            },
  -
  -            %% TEST GET METADATA FOR SHARED FILE WITH METADATA SET
  -
  -            #scenario_spec{
  -                name = <<"Get ", MetadataType/binary, " metadata from shared ", FileType/binary, " with ", MetadataType/binary, " set using /data/ rest endpoint">>,
  -                type = rest,
  -                target_nodes = Providers,
  -                client_spec = ClientSpecForShareScenarios,
  -                prepare_args_fun = ?GET_METADATA_REST_ARGS_FUN(MetadataType, ShareObjectId, QsParameters),
  -                validate_result_fun = ConstructValidateSuccessfulRestResultFun(ShareId, true),
  -                data_spec = DataSpec
  -            },
  -            #scenario_spec{
  -                name = <<"Get ", MetadataType/binary, " metadata from shared ", FileType/binary, " with ", MetadataType/binary, " set using /files-id/ rest endpoint">>,
  -                type = rest,
  -                target_nodes = Providers,
  -                client_spec = ClientSpecForShareScenarios,
  -                prepare_args_fun = ?GET_METADATA_DEPRECATED_ID_REST_ARGS_FUN(MetadataType, ShareObjectId, QsParameters),
  -                validate_result_fun = ConstructValidateSuccessfulRestResultFun(ShareId, true),
  -                data_spec = DataSpec
  -            },
  -            #scenario_spec{
  -                name = <<"Get ", MetadataType/binary, " metadata from shared ", FileType/binary, " with ", MetadataType/binary, " set using gs public api">>,
  -                type = gs,
  -                target_nodes = Providers,
  -                client_spec = ClientSpecForShareScenarios,
  -                prepare_args_fun = ?GET_METADATA_GS_ARGS_FUN(MetadataType, ShareGuid, public),
  -                validate_result_fun = ConstructValidateSuccessfulGsResultFun(ShareId, true),
  -                data_spec = DataSpec
  -            },
  -            #scenario_spec{
  -                name = <<"Get ", MetadataType/binary, " metadata from shared ", FileType/binary, " with ", MetadataType/binary, " set using private gs api">>,
  -                type = gs,
  -                target_nodes = Providers,
  -                client_spec = ClientSpecForShareScenarios,
  -                prepare_args_fun = ?GET_METADATA_GS_ARGS_FUN(MetadataType, ShareGuid, private),
  -                validate_result_fun = fun(_, Result) ->
  -                    ?assertEqual(?ERROR_UNAUTHORIZED, Result)
  -                end,
  -                data_spec = DataSpec
  -            },
  -
  -            %% TEST GET METADATA FOR FILE WITHOUT METADATA SET
  -
  -            #scenario_spec{
  -                name = <<"Get ", MetadataType/binary, " metadata from ", FileType/binary, " without ", MetadataType/binary, " set using /data/ rest endpoint">>,
  -                type = rest,
  -                target_nodes = Providers,
  -                client_spec = ClientSpecForGetJsonInSpace2Scenarios,
  -                prepare_args_fun = ?GET_METADATA_REST_ARGS_FUN(MetadataType, FileWithoutJsonMetadataObjectId, QsParameters),
  -                validate_result_fun = ConstructValidateSuccessfulRestResultFun(undefined, false),
  -                data_spec = DataSpec
  -            },
  -            #scenario_spec{
  -                name = <<"Get ", MetadataType/binary, " metadata from ", FileType/binary, " without ", MetadataType/binary, " set using /files/ rest endpoint">>,
  -                type = rest_with_file_path,
  -                target_nodes = Providers,
  -                client_spec = ClientSpecForGetJsonInSpace2Scenarios,
  -                prepare_args_fun = ?GET_METADATA_DEPRECATED_PATH_REST_ARGS_FUN(MetadataType, FileWithoutJsonMetadataPath, QsParameters),
  -                validate_result_fun = ConstructValidateSuccessfulRestResultFun(undefined, false),
  -                data_spec = DataSpec
  -            },
  -            #scenario_spec{
  -                name = <<"Get ", MetadataType/binary, " metadata from ", FileType/binary, " without ", MetadataType/binary, " set using /files-id/ rest endpoint">>,
  -                type = rest,
  -                target_nodes = Providers,
  -                client_spec = ClientSpecForGetJsonInSpace2Scenarios,
  -                prepare_args_fun = ?GET_METADATA_DEPRECATED_ID_REST_ARGS_FUN(MetadataType, FileWithoutJsonMetadataObjectId, QsParameters),
  -                validate_result_fun = ConstructValidateSuccessfulRestResultFun(undefined, false),
  -                data_spec = DataSpec
  -            },
  -            #scenario_spec{
  -                name = <<"Get ", MetadataType/binary, " metadata from ", FileType/binary, " without ", MetadataType/binary, " set using gs api">>,
  -                type = gs,
  -                target_nodes = Providers,
  -                client_spec = ClientSpecForGetJsonInSpace2Scenarios,
  -                prepare_args_fun = ?GET_METADATA_GS_ARGS_FUN(MetadataType, FileWithoutJsonMetadataGuid, private),
  -                validate_result_fun = ConstructValidateSuccessfulGsResultFun(undefined, false),
  -                data_spec = DataSpec
  -            }
  -        ]))
  -    end, FilesInSpace2List),
  -
  -    %% TEST GET METADATA FOR FILE ON PROVIDER NOT SUPPORTING USER
  -
  -    Provider2DomainBin = ?GET_DOMAIN_BIN(Provider2),
  -
  -    ClientSpecForGetMetadataInSpace1Scenarios = #client_spec{
  -        correct = [?USER_IN_SPACE_1_AUTH, ?USER_IN_BOTH_SPACES_AUTH],
  -        unauthorized = [?NOBODY],
  -        forbidden = [?USER_IN_SPACE_2_AUTH],
  -        supported_clients_per_node = SupportedClientsPerNode
  -    },
  -
  -    ExpSpace1Metadata = case MetadataType of
  -        <<"json">> -> ?JSON_METADATA_4;
  -        <<"rdf">> -> ?RDF_METADATA_1;
  -        <<"xattrs">> -> #{?XATTR_1_KEY => ?XATTR_1_VALUE}
  -    end,
  -    ValidateRestGetMetadataOnProvidersNotSupportingUserFun = fun
  -        (#api_test_ctx{node = Node, client = Client}, {ok, ?HTTP_400_BAD_REQUEST, Response}) when
  -            Node == Provider2,
  -            Client == ?USER_IN_BOTH_SPACES_AUTH
  -        ->
  -            ?assertEqual(?REST_ERROR(?ERROR_SPACE_NOT_SUPPORTED_BY(Provider2DomainBin)), Response);
  -        (_TestCaseCtx, {ok, ?HTTP_200_OK, Response}) ->
  -            ?assertEqual(ExpSpace1Metadata, Response)
  -    end,
  -    Space1Guid = fslogic_uuid:spaceid_to_space_dir_guid(?SPACE_1),
  -    set_all_metadata_types(Provider1, ?ROOT_SESS_ID, Space1Guid, set_1),
  -    {ok, Space1ObjectId} = file_id:guid_to_objectid(Space1Guid),
   
       ?assert(api_test_utils:run_scenarios(Config, [
           #scenario_spec{
  -            name = <<"Get ", MetadataType/binary, " metadata from ", ?SPACE_1/binary, " with ", MetadataType/binary, " set on provider not supporting user using /data/ rest endpoint">>,
  +            name = <<"Get ", MetadataType/binary, " metadata from shared ", FileType/binary, " using rest endpoint">>,
               type = rest,
               target_nodes = Providers,
  -            client_spec = ClientSpecForGetMetadataInSpace1Scenarios,
  -            prepare_args_fun = ?GET_METADATA_REST_ARGS_FUN(MetadataType, Space1ObjectId, QsParameters),
  -            validate_result_fun = ValidateRestGetMetadataOnProvidersNotSupportingUserFun
  +            client_spec = ClientSpec,
  +            prepare_args_fun = ?GET_METADATA_REST_ARGS_FUN(MetadataType, FileShareObjectId, QsParameters),
  +            validate_result_fun = ValidateRestCallResultFun,
  +            data_spec = DataSpec
           },
           #scenario_spec{
  -            name = <<"Get ", MetadataType/binary, " metadata from ", ?SPACE_1/binary, " with ", MetadataType/binary, " set on provider not supporting user using /files/ rest endpoint">>,
  -            type = rest_with_file_path,
  +            name = <<"Get ", MetadataType/binary, " metadata from shared ", FileType/binary, " using deprecated id rest endpoint">>,
  +            type = rest,
               target_nodes = Providers,
  -            client_spec = ClientSpecForGetMetadataInSpace1Scenarios,
  -            prepare_args_fun = ?GET_METADATA_DEPRECATED_PATH_REST_ARGS_FUN(MetadataType, <<"/", ?SPACE_1/binary>>, QsParameters),
  -            validate_result_fun = ValidateRestGetMetadataOnProvidersNotSupportingUserFun
  +            client_spec = ClientSpec,
  +            prepare_args_fun = ?GET_METADATA_DEPRECATED_ID_REST_ARGS_FUN(MetadataType, FileShareObjectId, QsParameters),
  +            validate_result_fun = ValidateRestCallResultFun,
  +            data_spec = DataSpec
           },
           #scenario_spec{
  -            name = <<"Get ", MetadataType/binary, " metadata from ", ?SPACE_1/binary, " with ", MetadataType/binary, " set on provider not supporting user using /files-id/ rest endpoint">>,
  -            type = rest,
  +            name = <<"Get ", MetadataType/binary, " metadata from shared ", FileType/binary, " using gs public api">>,
  +            type = gs,
               target_nodes = Providers,
  -            client_spec = ClientSpecForGetMetadataInSpace1Scenarios,
  -            prepare_args_fun = ?GET_METADATA_DEPRECATED_ID_REST_ARGS_FUN(MetadataType, Space1ObjectId, QsParameters),
  -            validate_result_fun = ValidateRestGetMetadataOnProvidersNotSupportingUserFun
  +            client_spec = ClientSpec,
  +            prepare_args_fun = ?GET_METADATA_GS_ARGS_FUN(MetadataType, FileShareGuid, public),
  +            validate_result_fun = ValidateGsCallResultFun,
  +            data_spec = DataSpec
           },
           #scenario_spec{
  -            name = <<"Get ", MetadataType/binary, " metadata from ", ?SPACE_1/binary, " with ", MetadataType/binary, " set on provider not supporting user using gs api">>,
  +            name = <<"Get ", MetadataType/binary, " metadata from shared ", FileType/binary, " using private gs api">>,
               type = gs,
               target_nodes = Providers,
  -            client_spec = ClientSpecForGetMetadataInSpace1Scenarios,
  -            prepare_args_fun = ?GET_METADATA_GS_ARGS_FUN(MetadataType, Space1Guid, private),
  -            validate_result_fun = fun
  -                (#api_test_ctx{node = Node, client = Client}, Result) when
  -                    Node == Provider2,
  -                    Client == ?USER_IN_BOTH_SPACES_AUTH
  -                ->
  -                    ?assertEqual(?ERROR_SPACE_NOT_SUPPORTED_BY(Provider2DomainBin), Result);
  -                (_TestCaseCtx, {ok, Result}) ->
  -                    ?assertEqual(#{<<"metadata">> => ExpSpace1Metadata}, Result)
  -            end
  +            client_spec = ClientSpec,
  +            prepare_args_fun = ?GET_METADATA_GS_ARGS_FUN(MetadataType, FileShareGuid, private),
  +            validate_result_fun = fun(_, Result) ->
  +                ?assertEqual(?ERROR_UNAUTHORIZED, Result)
  +            end,
  +            data_spec = DataSpec
           }
       ])).
   
  
positive.code:         false -> ?CLIENT_SPEC_FOR_SPACE_2_SCENARIOS(Config)
      end,
      DataSpec = #data_spec{
          optional = [<<"inherited">>, <<"filter_type">>, <<"filter">>],
          correct_values = #{
              <<"inherited">> => [true, false],
              <<"filter_type">> => [<<"keypath">>],
  
negative.code:         get_shared_file_json_metadata_without_json_set_test,
          get_shared_dir_json_metadata_without_json_set_test,
          get_file_json_metadata_on_provider_not_supporting_space_test,
          get_dir_json_metadata_on_provider_not_supporting_space_test,
  
          get_file_xattrs_with_json_set_test,
          get_dir_xattrs_with_json_set_test,
          get_file_xattrs_without_json_set_test,
          get_dir_xattrs_without_json_set_test,
          get_shared_file_xattrs_with_json_set_test,
          get_shared_dir_xattrs_with_json_set_test,
          get_shared_file_xattrs_without_json_set_test,
          get_shared_dir_xattrs_without_json_set_test,
          get_file_xattrs_on_provider_not_supporting_space_test,
          get_dir_xattrs_on_provider_not_supporting_space_test
  
  
  %%        set_rdf_metadata_test,
  %%        set_json_metadata_test
      ]).
  