anchor.diff:              },
               <<"c">> => <<"d">>
           },
  -        elasticsearch_harvesting_backend:prepare_data(#{
  -            <<"fileId">> => <<"fileId">>,
  -            <<"fileName">> => <<"fileName">>,
  -            <<"payload">> => #{
  -                <<"json">> => <<"{\"a\":\"B\", \"c\":\"d\"}">>,
  -                <<"xattrs">> => #{<<"x">> => <<"y">>, <<"z">> => <<"b">>}
  -            },
  -            <<"spaceId">> => <<"spaceId">>
  -        }, IndexInfo, {[<<"a">>, <<"x">>, <<"__onedata.xattrs.z">>], <<"Rejection reason">>})
  +        call_prepare_data(#{
  +            <<"json">> => <<"{\"a\":\"B\", \"c\":\"d\"}">>,
  +            <<"xattrs">> => #{<<"x">> => <<"y">>, <<"z">> => <<"b">>}
  +        }, IndexInfo, [<<"a">>, <<"x">>, <<"__onedata.xattrs.z">>])
       ),
       
       ?assertEqual(
  
positive.code: unmock_do_submit_request() ->
      meck:unload(elasticsearch_harvesting_backend).
  
  -endif.
  
negative.code:             },
              <<"__onedata.__rejected">> => <<"[{\"a\":\"B\"}]">>
          },
          call_prepare_data(#{
              <<"json">> => [#{<<"a">> => <<"B">>}],
              <<"xattrs">> => #{<<"x">> => <<"y">>},
              <<"rdf">> => <<"some rdf">>
          }, IndexInfo, [<<"__onedata.xattrs.z">>])
      ),
      
      ?assertEqual(
          #{
              <<"__onedata">> => ExpectedInternalMetadata#{
                  <<"rdfMetadataExists">> => false,
                  <<"xattrsMetadataExists">> => false
              },
              <<"__onedata.__rejected">> => <<"[]">>
          },
          call_prepare_data(#{<<"json">> => []}, IndexInfo, [])
      ),
      
      ?assertEqual(
          #{
              <<"__onedata">> => ExpectedInternalMetadata#{
                  <<"rdfMetadataExists">> => false,
                  <<"xattrsMetadataExists">> => false
              },
              <<"__onedata.__rejected">> => <<"\"string_json\"">>
          },
          call_prepare_data(#{<<"json">> => <<"string_json">>}, IndexInfo, [])
      ),
      
      ?assertEqual(
          #{
              <<"__onedata">> => ExpectedInternalMetadata#{
                  <<"rdfMetadataExists">> => false,
                  <<"xattrsMetadataExists">> => false
              },
              <<"__onedata.__rejected">> => <<"8">>
          },
          call_prepare_data(#{<<"json">> => 8}, IndexInfo, [])),
      ok.
  
  
  