anchor.diff:  
           #scenario_spec{
               type = rest,
  -            target_nodes = [Provider1, Provider2],
  -            client_spec = ClientSpec,
  -            prepare_args_fun = ConstructPrepareRestArgsFun(RootDirObjectId),
  -            validate_result_fun = fun(_TargetNode, {ok, ?HTTP_200_OK, Response}, _Env, Data) ->
  -                ValidateListedChildren(rest, files, undefined, Data, Response)
  +            target_nodes = Providers,
  +            client_spec = ClientSpecForSpace2Listing,
  +            prepare_args_fun = ConstructPrepareRestArgsFun(DirObjectId),
  +            validate_result_fun = fun(_TargetNode, {ok, ?HTTP_200_OK, Response}, _Env, Data) ->
  +                validate_listed_files(Response, rest, undefined, Data, Files)
  +            end,
  +            data_spec = ParamsSpec
  +        },
  +        #scenario_spec{
  +            type = rest_with_file_path,
  +            target_nodes = Providers,
  +            client_spec = ClientSpecForSpace2Listing,
  +            prepare_args_fun = ConstructPrepareDeprecatedPathRestArgsFun(DirPath),
  +            validate_result_fun = fun(_TargetNode, {ok, ?HTTP_200_OK, Response}, _Env, Data) ->
  +                validate_listed_files(Response, deprecated_rest, undefined, Data, Files)
  +            end,
  +            data_spec = ParamsSpec
  +        },
  +        #scenario_spec{
  +            type = rest,
  +            target_nodes = Providers,
  +            client_spec = ClientSpecForSpace2Listing,
  +            prepare_args_fun = ConstructPrepareDeprecatedIdRestArgsFun(DirObjectId),
  +            validate_result_fun = fun(_TargetNode, {ok, ?HTTP_200_OK, Response}, _Env, Data) ->
  +                validate_listed_files(Response, deprecated_rest, undefined, Data, Files)
               end,
               data_spec = ParamsSpec
           },
           #scenario_spec{
               type = gs,
  -            target_nodes = [Provider1, Provider2],
  -            client_spec = ClientSpec,
  -            prepare_args_fun = ConstructPrepareGsArgsFun(RootDirGuid, private),
  +            target_nodes = Providers,
  +            client_spec = ClientSpecForSpace2Listing,
  +            prepare_args_fun = ConstructPrepareGsArgsFun(DirGuid, private),
               validate_result_fun = fun(_TargetNode, {ok, Result}, _Env, Data) ->
  -                ValidateListedChildren(gs, files, undefined, Data, Result)
  +                validate_listed_files(Result, gs, undefined, Data, Files)
               end,
               data_spec = ParamsSpec
           },
  
positive.code:         {Space2Guid, Space2, <<"/", Space2/binary>>}
      ],
  
      UserSessId = SessId(Provider2),
  
      RootDirName = ?SCENARIO_NAME,
      RootDirPath = filename:join(["/", Space2, RootDirName]),
      {ok, RootDirGuid} = lfm_proxy:mkdir(Provider2, UserSessId, RootDirPath, 8#777),
      {ok, RootDirObjectId} = file_id:guid_to_objectid(RootDirGuid),
  
      {ok, ShareId} = lfm_proxy:create_share(Provider2, UserSessId, {guid, RootDirGuid}, <<"share">>),
      ShareRootDirGuid = file_id:guid_to_share_guid(RootDirGuid, ShareId),
      {ok, ShareRootDirObjectId} = file_id:guid_to_objectid(ShareRootDirGuid),
  
      Files = [{FileGuid1, _, FilePath1} | _] = lists:map(fun(Num) ->
          FileName = <<"file", Num>>,
          {ok, FileGuid} = lfm_proxy:create(Provider2, UserSessId, RootDirGuid, FileName, 8#777),
          {FileGuid, FileName, filename:join([RootDirPath, FileName])}
      end, [$0, $1, $2, $3, $4]),
      {ok, FileObjectId1} = file_id:guid_to_objectid(FileGuid1),
  
      % Wait for sync between providers
      ?assertMatch({ok, _}, lfm_proxy:stat(Provider1, SessId(Provider1), {guid, FileGuid1}), ?ATTEMPTS),
  
      ClientSpec = #client_spec{
          correct = [{user, UserId}],
          unauthorized = [nobody],
          forbidden = [{user, <<"user1">>}]
      },
  
      ShareClientSpec = #client_spec{
          correct = [nobody, {user, <<"user1">>}, {user, UserId}],
          unauthorized = [],
          forbidden = []
      },
  
      ConstructPrepareRestArgsFun = fun(FileId) ->
          fun(_Env, Data) ->
              Qs = prepare_list_dir_qs(Data),
              #rest_args{
                  method = get,
                  path = <<"data/", FileId/binary, "/children", Qs/binary>>
  
negative.code:             end,
              data_spec = ParamsSpec
          },
          % TODO fix
  %%        #scenario_spec{
  %%            type = gs,
  %%            target_nodes = Providers,
  %%            client_spec = ClientSpecForSpace2Listing,
  %%            prepare_args_fun = ConstructPrepareGsArgsFun(FileGuid1, private),
  %%            validate_result_fun = fun(_TargetNode, Result, _, _) ->
  %%                ?assertEqual(?ERROR_POSIX(?ENOTDIR), Result)
  %%            end,
  %%            data_spec = ParamsSpec
  %%        },
  
  
          %% LISTING USER ROOT DIR SHOULD LIST ALL SPACES ALSO THOSE NOT SUPPORTED LOCALLY
  
          #scenario_spec{
              type = rest,
              target_nodes = Providers,
              client_spec = ClientSpecForUserInBothSpacesUserRootDirListing,
              prepare_args_fun = ConstructPrepareRestArgsFun(UserInBothSpacesRootDirObjectId),
              validate_result_fun = fun(_TargetNode, {ok, ?HTTP_200_OK, Response}, _Env, Data) ->
                  validate_listed_files(Response, rest, undefined, Data, Spaces)
              end,
              data_spec = ParamsSpec
          },
          % Special case - listing files using path '/' works for all users but
          % returns only user spaces
          % TODO fix for all users
          #scenario_spec{
              type = rest_with_file_path,
              target_nodes = Providers,
              client_spec = ClientSpecForUserInBothSpacesUserRootDirListing#client_spec{
                  unauthorized = [],
                  forbidden = []
              },
              prepare_args_fun = ConstructPrepareDeprecatedPathRestArgsFun(<<"/">>),
              validate_result_fun = fun(_TargetNode, {ok, ?HTTP_200_OK, Response}, _Env, Data) ->
                  validate_listed_files(Response, deprecated_rest, undefined, Data, Spaces)
              end,
              data_spec = ParamsSpec
          },
          #scenario_spec{
              type = rest,
              target_nodes = Providers,
              client_spec = ClientSpecForUserInBothSpacesUserRootDirListing,
              prepare_args_fun = ConstructPrepareDeprecatedIdRestArgsFun(UserInBothSpacesRootDirObjectId),
              validate_result_fun = fun(_TargetNode, {ok, ?HTTP_200_OK, Response}, _Env, Data) ->
                  validate_listed_files(Response, deprecated_rest, undefined, Data, Spaces)
              end,
              data_spec = ParamsSpec
          },
          #scenario_spec{
              type = gs,
              target_nodes = Providers,
              client_spec = ClientSpecForUserInBothSpacesUserRootDirListing,
              prepare_args_fun = ConstructPrepareGsArgsFun(UserInBothSpacesRootDirGuid, private),
              validate_result_fun = fun(_TargetNode, {ok, Result}, _, Data) ->
                  validate_listed_files(Result, gs, undefined, Data, Spaces)
              end,
              data_spec = ParamsSpec
          }
  
  
  
  
  
  
  
  %%        %% TEST LISTING ON PROVIDERS NOT SUPPORTING SPACE
  %%
  %%        #scenario_spec{
  %%            type = rest,
  %%            target_nodes = Providers,
  %%            client_spec = ClientSpecForSpace2Listing#client_spec{forbidden = [{user, <<"user3">>}]},
  %%            prepare_args_fun = ConstructPrepareRestArgsFun(Space1ObjectId),
  %%            validate_result_fun = fun
  %%                (Target, {ok, ?HTTP_400_BAD_REQUEST, Response}, _Env, _Data) when Target == Provider2 ->
  %%                    ExpError = #{<<"error">> => errors:to_json(?ERROR_SPACE_NOT_SUPPORTED_BY(Provider2DomainBin))},
  %%                    ?assertEqual(ExpError, Response);
  %%                (_TargetNode, {ok, ?HTTP_200_OK, Response}, _Env, _Data) ->
  %%                    ?assertEqual(#{<<"children">> => []}, Response)
  %%            end,
  %%            data_spec = ParamsSpec
  %%        },
  %%        #scenario_spec{
  %%            type = rest_with_file_path,
  %%            target_nodes = Providers,
  %%            client_spec = ClientSpecForSpace2Listing#client_spec{forbidden = [{user, <<"user3">>}]},
  %%            prepare_args_fun = ConstructPrepareDeprecatedPathRestArgsFun(<<"/", Space1/binary>>),
  %%            validate_result_fun = fun
  %%                (Target, {ok, ?HTTP_400_BAD_REQUEST, Response}, _Env, _Data) when Target == Provider2 ->
  %%                    ExpError = #{<<"error">> => errors:to_json(?ERROR_SPACE_NOT_SUPPORTED_BY(Provider2DomainBin))},
  %%                    ?assertEqual(ExpError, Response);
  %%                (_TargetNode, {ok, ?HTTP_200_OK, Response}, _Env, _Data) ->
  %%                    ?assertEqual([], Response)
  %%            end,
  %%            data_spec = ParamsSpec
  %%        },
  %%        #scenario_spec{
  %%            type = rest,
  %%            target_nodes = Providers,
  %%            client_spec = ClientSpecForSpace2Listing#client_spec{forbidden = [{user, <<"user3">>}]},
  %%            prepare_args_fun = ConstructPrepareDeprecatedIdRestArgsFun(Space1ObjectId),
  %%            validate_result_fun = fun
  %%                (Target, {ok, ?HTTP_400_BAD_REQUEST, Response}, _Env, _Data) when Target == Provider2 ->
  %%                    ExpError = #{<<"error">> => errors:to_json(?ERROR_SPACE_NOT_SUPPORTED_BY(Provider2DomainBin))},
  %%                    ?assertEqual(ExpError, Response);
  %%                (_TargetNode, {ok, ?HTTP_200_OK, Response}, _Env, _Data) ->
  %%                    ?assertEqual([], Response)
  %%            end,
  %%            data_spec = ParamsSpec
  %%        },
  %%        #scenario_spec{
  %%            type = gs,
  %%            target_nodes = Providers,
  %%            client_spec = ClientSpecForSpace2Listing#client_spec{forbidden = [{user, <<"user3">>}]},
  %%            prepare_args_fun = ConstructPrepareGsArgsFun(Space1Guid, private),
  %%            validate_result_fun = fun
  %%                (Target, Result, _, _Data) when Target == Provider2 ->
  %%                    ?assertEqual(?ERROR_SPACE_NOT_SUPPORTED_BY(Provider2DomainBin), Result);
  %%                (_TargetNode, {ok, Result}, _, _Data) ->
  %%                    ?assertEqual(#{<<"children">> => []}, Result)
  %%            end,
  %%            data_spec = ParamsSpec
  %%        }
      ])).
  
  
  