anchor.diff:              {<<"attribute">>, <<"NaN">>, ?ERROR_BAD_VALUE_NOT_ALLOWED(<<"attribute">>, ?PUBLIC_BASIC_ATTRIBUTES)},
               {<<"attribute">>, <<"owner_id">>, ?ERROR_BAD_VALUE_NOT_ALLOWED(<<"attribute">>, ?PUBLIC_BASIC_ATTRIBUTES)}
           ]
  -    },
  -
  -    GetExpectedResultFun = fun(#api_test_ctx{data = Data}, ShareId, JsonAttrs) ->
  -        RequestedAttributes = case maps:get(<<"attribute">>, Data, undefined) of
  -            undefined ->
  -                case ShareId of
  -                    undefined -> ?PRIVATE_BASIC_ATTRIBUTES;
  -                    _ -> ?PUBLIC_BASIC_ATTRIBUTES
  -                end;
  -            Attr ->
  -                [Attr]
  -        end,
  -        {ok, maps:with(RequestedAttributes, JsonAttrs)}
  -    end,
  -    ConstructValidateSuccessfulRestResultFun = fun(ShareId, JsonAttrsInNormalMode) ->
  -        fun(TestCtx, {ok, RespCode, RespBody}) ->
  -            {ExpCode, ExpBody} = case GetExpectedResultFun(TestCtx, ShareId, JsonAttrsInNormalMode) 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, JsonAttrsInNormalMode) ->
  -        fun(TestCtx, Result) ->
  -            case GetExpectedResultFun(TestCtx, ShareId, JsonAttrsInNormalMode) of
  -                {ok, ExpResult} ->
  -                    ?assertEqual({ok, #{<<"attributes">> => ExpResult}}, Result);
  -                {error, _} = ExpError ->
  -                    ?assertEqual(ExpError, Result)
  -            end
  -        end
  -    end,
  -
  -    ConstructPrepareRestArgsFun = fun(FileId) ->
  -        fun(#api_test_ctx{data = Data}) ->
  -            #rest_args{
  -                method = get,
  -                path = http_utils:append_url_parameters(
  -                    <<"data/", FileId/binary>>,
  -                    maps:with([<<"attribute">>], Data)
  -                )
  -            }
  -        end
  -    end,
  -    ConstructPrepareDeprecatedFilePathRestArgsFun = fun(FilePath) ->
  -        fun(#api_test_ctx{data = Data}) ->
  -            #rest_args{
  -                method = get,
  -                path = http_utils:append_url_parameters(
  -                    <<"metadata/attrs", FilePath/binary>>,
  -                    maps:with([<<"attribute">>], Data)
  -                )
  -            }
  -        end
  -    end,
  -    ConstructPrepareDeprecatedFileIdRestArgsFun = fun(Fileid) ->
  -        fun(#api_test_ctx{data = Data}) ->
  -            #rest_args{
  -                method = get,
  -                path = http_utils:append_url_parameters(
  -                    <<"metadata-id/attrs/", Fileid/binary>>,
  -                    maps:with([<<"attribute">>], Data)
  -                )
  -            }
  -        end
  -    end,
  -    ConstructPrepareGsArgsFun = fun(FileId, Scope) ->
  -        fun(#api_test_ctx{data = Data}) ->
  -            #gs_args{
  -                operation = get,
  -                gri = #gri{type = op_file, id = FileId, aspect = attrs, scope = Scope},
  -                data = Data
  -            }
  -        end
  -    end,
  -
  -    lists:foreach(fun({FileType, FilePath, FileGuid}) ->
  -        {ok, FileObjectId} = file_id:guid_to_objectid(FileGuid),
  -
  -        {ok, ShareId1} = lfm_proxy:create_share(Provider2, UserSessId, {guid, FileGuid}, <<"share1">>),
  -        {ok, ShareId2} = lfm_proxy:create_share(Provider2, UserSessId, {guid, FileGuid}, <<"share2">>),
  -
  -        ShareGuid = file_id:guid_to_share_guid(FileGuid, ShareId1),
  -        {ok, ShareObjectId} = file_id:guid_to_objectid(ShareGuid),
  -
  -        {ok, FileAttrs} = ?assertMatch(
  -            {ok, #file_attr{shares = [ShareId2, ShareId1]}},
  -            lfm_proxy:stat(Provider1, GetSessionFun(Provider1), {guid, FileGuid}),
  -            ?ATTEMPTS
  -        ),
  -        JsonAttrsInNormalMode = attrs_to_json(undefined, FileAttrs),
  -        JsonAttrsInShareMode = attrs_to_json(ShareId1, FileAttrs),
  -
  -        ?assert(api_test_runner:run_tests(Config, [
  -
  -            %% TEST GET ATTRS FOR FILE IN NORMAL MODE
  -
  -            #scenario_spec{
  -                name = <<"Get attrs from ", FileType/binary, " using /data/ rest endpoint">>,
  -                type = rest,
  -                target_nodes = Providers,
  -                client_spec = ClientSpecForSpace2Scenarios,
  -                prepare_args_fun = ConstructPrepareRestArgsFun(FileObjectId),
  -                validate_result_fun = ConstructValidateSuccessfulRestResultFun(undefined, JsonAttrsInNormalMode),
  -                data_spec = PrivateDataSpec
  -            },
  -            #scenario_spec{
  -                name = <<"Get attrs from ", FileType/binary, " using /files/ rest endpoint">>,
  -                type = rest_with_file_path,
  -                target_nodes = Providers,
  -                client_spec = ClientSpecForSpace2Scenarios,
  -                prepare_args_fun = ConstructPrepareDeprecatedFilePathRestArgsFun(FilePath),
  -                validate_result_fun = ConstructValidateSuccessfulRestResultFun(undefined, JsonAttrsInNormalMode),
  -                data_spec = PrivateDataSpec
  -            },
  -            #scenario_spec{
  -                name = <<"Get attrs from ", FileType/binary, " using /files-id/ rest endpoint">>,
  -                type = rest,
  -                target_nodes = Providers,
  -                client_spec = ClientSpecForSpace2Scenarios,
  -                prepare_args_fun = ConstructPrepareDeprecatedFileIdRestArgsFun(FileObjectId),
  -                validate_result_fun = ConstructValidateSuccessfulRestResultFun(undefined, JsonAttrsInNormalMode),
  -                data_spec = PrivateDataSpec
  -            },
  -            #scenario_spec{
  -                name = <<"Get attrs from ", FileType/binary, " using gs api">>,
  -                type = gs,
  -                target_nodes = Providers,
  -                client_spec = ClientSpecForSpace2Scenarios,
  -                prepare_args_fun = ConstructPrepareGsArgsFun(FileGuid, private),
  -                validate_result_fun = ConstructValidateSuccessfulGsResultFun(undefined, JsonAttrsInNormalMode),
  -                data_spec = PrivateDataSpec
  -            },
  -
  -            %% TEST GET ATTRS FOR SHARED FILE
  -
  -            #scenario_spec{
  -                name = <<"Get attrs from shared ", FileType/binary, " using /data/ rest endpoint">>,
  -                type = rest,
  -                target_nodes = Providers,
  -                client_spec = ClientSpecForShareScenarios,
  -                prepare_args_fun = ConstructPrepareRestArgsFun(ShareObjectId),
  -                validate_result_fun = ConstructValidateSuccessfulRestResultFun(ShareId1, JsonAttrsInShareMode),
  -                data_spec = PublicDataSpec
  -            },
  -            #scenario_spec{
  -                name = <<"Get attrs from shared ", FileType/binary, " using /files-id/ rest endpoint">>,
  -                type = rest,
  -                target_nodes = Providers,
  -                client_spec = ClientSpecForShareScenarios,
  -                prepare_args_fun = ConstructPrepareDeprecatedFileIdRestArgsFun(ShareObjectId),
  -                validate_result_fun = ConstructValidateSuccessfulRestResultFun(ShareId1, JsonAttrsInShareMode),
  -                data_spec = PublicDataSpec
  -            },
  -            #scenario_spec{
  -                name = <<"Get attrs from shared ", FileType/binary, " using gs public api">>,
  -                type = gs,
  -                target_nodes = Providers,
  -                client_spec = ClientSpecForShareScenarios,
  -                prepare_args_fun = ConstructPrepareGsArgsFun(ShareGuid, public),
  -                validate_result_fun = ConstructValidateSuccessfulGsResultFun(ShareId1, JsonAttrsInShareMode),
  -                data_spec = PublicDataSpec
  -            },
  -            #scenario_spec{
  -                name = <<"Get attrs from shared ", FileType/binary, " using private gs api">>,
  -                type = gs,
  -                target_nodes = Providers,
  -                client_spec = ClientSpecForShareScenarios,
  -                prepare_args_fun = ConstructPrepareGsArgsFun(ShareGuid, private),
  -                validate_result_fun = fun(_, Result) ->
  -                    ?assertEqual(?ERROR_UNAUTHORIZED, Result)
  -                end,
  -                data_spec = PrivateDataSpec
  -            }
  -        ]))
  -    end, [
  -        {<<"dir">>, DirPath, DirGuid},
  -        {<<"file">>, RegularFilePath, RegularFileGuid}
  -    ]),
  -
  -    %% TEST GET ATTRS FOR FILE ON PROVIDER NOT SUPPORTING USER
  -
  -    Provider2DomainBin = ?GET_DOMAIN_BIN(Provider2),
  -
  -    ClientSpecForSpace1Scenarios = #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
  -    },
  -
  -    Space1Guid = fslogic_uuid:spaceid_to_space_dir_guid(?SPACE_1),
  -    {ok, Space1ObjectId} = file_id:guid_to_objectid(Space1Guid),
  -    {ok, Space1Attrs} = lfm_proxy:stat(Provider1, GetSessionFun(Provider1), {guid, Space1Guid}),
  -    Space1JsonAttrs = attrs_to_json(undefined, Space1Attrs),
  -
  -    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}) ->
  -            {ok, ExpAttrs} = GetExpectedResultFun(TestCaseCtx, undefined, Space1JsonAttrs),
  -            ?assertEqual(ExpAttrs, Response)
  -    end,
  -
  -    ?assert(api_test_runner:run_tests(Config, [
  -        #scenario_spec{
  -            name = <<"Get attrs from ", ?SPACE_1/binary, " on provider not supporting user using /data/ rest endpoint">>,
  -            type = rest,
  -            target_nodes = Providers,
  -            client_spec = ClientSpecForSpace1Scenarios,
  -            prepare_args_fun = ConstructPrepareRestArgsFun(Space1ObjectId),
  -            validate_result_fun = ValidateRestGetMetadataOnProvidersNotSupportingUserFun,
  -            data_spec = PrivateDataSpec
  -        },
  -        #scenario_spec{
  -            name = <<"Get attrs from ", ?SPACE_1/binary, " on provider not supporting user using /files/ rest endpoint">>,
  -            type = rest_with_file_path,
  -            target_nodes = Providers,
  -            client_spec = ClientSpecForSpace1Scenarios,
  -            prepare_args_fun = ConstructPrepareDeprecatedFilePathRestArgsFun(<<"/", ?SPACE_1/binary>>),
  -            validate_result_fun = ValidateRestGetMetadataOnProvidersNotSupportingUserFun,
  -            data_spec = PrivateDataSpec
  -        },
  -        #scenario_spec{
  -            name = <<"Get attrs from ", ?SPACE_1/binary, " on provider not supporting user using /files-id/ rest endpoint">>,
  -            type = rest,
  -            target_nodes = Providers,
  -            client_spec = ClientSpecForSpace1Scenarios,
  -            prepare_args_fun = ConstructPrepareDeprecatedFileIdRestArgsFun(Space1ObjectId),
  -            validate_result_fun = ValidateRestGetMetadataOnProvidersNotSupportingUserFun,
  -            data_spec = PrivateDataSpec
  -        },
  -        #scenario_spec{
  -            name = <<"Get attrs from ", ?SPACE_1/binary, " on provider not supporting user using gs api">>,
  -            type = gs,
  -            target_nodes = Providers,
  -            client_spec = ClientSpecForSpace1Scenarios,
  -            prepare_args_fun = ConstructPrepareGsArgsFun(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}) ->
  -                    {ok, ExpAttrs} = GetExpectedResultFun(TestCaseCtx, undefined, Space1JsonAttrs),
  -                    ?assertEqual(#{<<"attributes">> => ExpAttrs}, Result)
  -            end,
  -            data_spec = PrivateDataSpec
  -        }
  -    ])).
  +    }.
  +
  +
  +%%%===================================================================
  +%%% Set mode test functions
  +%%%===================================================================
   
   
   set_mode_test(Config) ->
  
positive.code:         get_user_root_dir_children_test,
          get_dir_children_on_provider_not_supporting_space_test,
  
          get_attrs_test,
          set_mode_test
      ]).
  
  
negative.code:             {<<"attribute">>, 10, {gs, ?ERROR_BAD_VALUE_BINARY(<<"attribute">>)}},
              {<<"attribute">>, <<"NaN">>, ?ERROR_BAD_VALUE_NOT_ALLOWED(<<"attribute">>, ?PRIVATE_BASIC_ATTRIBUTES)}
          ]
      };
  get_attrs_data_spec(share_mode) ->
      #data_spec{
          optional = [<<"attribute">>],
          correct_values = #{<<"attribute">> => ?PUBLIC_BASIC_ATTRIBUTES},
          bad_values = [
  