anchor.diff:                      ?assertEqual(ExpError, Result)
               end
       end.
  -
  -
  -%% @private
  -get_metadata_in_normal_mode_test_base(
  -    MetadataType, FileType, FilePath, FileGuid,
  -    ValidateRestCallResultFun, ValidateGsCallResultFun,
  -    Providers, ClientSpec, DataSpec, QsParameters, Config
  -) ->
  -    {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
  -        }
  -    ])).
   
   
   %% @private
  
positive.code:         FileType, FileLayer5Path, FileLayer5Guid, ShareId,
          create_validate_get_metadata_rest_call_fun(GetExpCallResultFun),
          create_validate_get_metadata_gs_call_fun(GetExpCallResultFun),
          Providers,
          ClientSpec,
          DataSpec,
          _QsParams = [<<"inherited">>, <<"filter_type">>, <<"filter">>],
  
negative.code: 
  
  %%%===================================================================
  %%% Get Rdf metadata test functions
  %%%===================================================================
  
  
  get_file_rdf_metadata_with_rdf_set_test(Config) ->
      get_rdf_metadata_test_base(<<"file">>, _SetRdf = true, _TestShareMode = false, Config).
  
  
  get_dir_rdf_metadata_with_rdf_set_test(Config) ->
      get_rdf_metadata_test_base(<<"dir">>, _SetRdf = true, _TestShareMode = false, Config).
  
  
  get_file_rdf_metadata_without_rdf_set_test(Config) ->
      get_rdf_metadata_test_base(<<"file">>, _SetRdf = false, _TestShareMode = false, Config).
  
  
  get_dir_rdf_metadata_without_rdf_set_test(Config) ->
      get_rdf_metadata_test_base(<<"dir">>, _SetRdf = false, _TestShareMode = false, Config).
  
  
  get_shared_file_rdf_metadata_with_rdf_set_test(Config) ->
      get_rdf_metadata_test_base(<<"file">>, _SetRdf = true, _TestShareMode = true, Config).
  
  
  get_shared_dir_rdf_metadata_with_rdf_set_test(Config) ->
      get_rdf_metadata_test_base(<<"dir">>, _SetRdf = true, _TestShareMode = true, Config).
  
  
  get_shared_file_rdf_metadata_without_rdf_set_test(Config) ->
      get_rdf_metadata_test_base(<<"file">>, _SetRdf = false, _TestShareMode = true, Config).
  
  
  get_shared_dir_rdf_metadata_without_rdf_set_test(Config) ->
      get_rdf_metadata_test_base(<<"dir">>, _SetRdf = false, _TestShareMode = true, Config).
  
  
  %% @private
  get_rdf_metadata_test_base(FileType, SetRdf, TestShareMode, Config) ->
      [P2, P1] = ?config(op_worker_nodes, Config),
      SessIdP1 = ?USER_IN_BOTH_SPACES_SESS_ID(P1, Config),
      SessIdP2 = ?USER_IN_BOTH_SPACES_SESS_ID(P2, Config),
  
      FilePath = filename:join(["/", ?SPACE_2, ?RANDOM_FILE_NAME]),
      {ok, FileGuid} = create_file(FileType, P1, SessIdP1, FilePath),
  
      GetExpCallResultFun = case SetRdf of
          true ->
              lfm_proxy:set_metadata(P1, SessIdP1, {guid, FileGuid}, rdf, ?RDF_METADATA_1, []),
              fun(_TestCtx) -> {ok, ?RDF_METADATA_1} end;
          false ->
              fun(_TestCtx) -> ?ERROR_POSIX(?ENODATA) end
      end,
      {ShareId, ClientSpec} = case TestShareMode of
          true ->
              {ok, Id} = lfm_proxy:create_share(P1, SessIdP1, {guid, FileGuid}, <<"share">>),
              {Id, ?CLIENT_SPEC_FOR_SHARE_SCENARIOS(Config)};
          false ->
              {undefined, ?CLIENT_SPEC_FOR_SPACE_2_SCENARIOS(Config)}
      end,
  
      % Wait for metadata sync between providers
      ?assertMatch({ok, _}, lfm_proxy:stat(P2, SessIdP2, {guid, FileGuid}), ?ATTEMPTS),
  
      get_metadata_test_base(
          <<"rdf">>,
          FileType, FilePath, FileGuid, ShareId,
          create_validate_get_metadata_rest_call_fun(GetExpCallResultFun),
          create_validate_get_metadata_gs_call_fun(GetExpCallResultFun),
          _Providers = ?config(op_worker_nodes, Config),
          ClientSpec,
          _DataSpec = undefined,
          _QsParams = [],
          Config
      ).
  
  
  get_file_rdf_metadata_on_provider_not_supporting_space_test(Config) ->
  