anchor.diff:  ]).
   
   -export([
  -    get_remote_op_details_test/1
  +    get_remote_op_details_test/1,
  +    get_op_test_image_test/1
   
   ]).
   
   all() -> [
  -    get_remote_op_details_test
  +    get_remote_op_details_test,
  +    get_op_test_image_test
  +
   ].
  +
  +-define(TEST_IMAGE, <<137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 1, 0, 0, 0, 1, 1, 3, 0, 0, 0, 37,
  +    219, 86, 202, 0, 0, 0, 6, 80, 76, 84, 69, 0, 0, 0, 255, 255, 255, 165, 217, 159, 221, 0, 0, 0, 9, 112,
  +    72, 89, 115, 0, 0, 14, 196, 0, 0, 14, 196, 1, 149, 43, 14, 27, 0, 0, 0, 10, 73, 68, 65, 84, 8, 153, 99,
  +    96, 0, 0, 0, 2, 0, 1, 244, 113, 100, 166, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130>>
  +).
   
   
   %%%===================================================================
  
positive.code: %%%===================================================================
  
  get_remote_op_details_test(Config) ->
      get_remote_op_details_test_base(Config, krakow).
  
  
  get_remote_op_details_test_base(Config, Provider) ->
      ProviderId = oct_background:get_provider_id(krakow),
      OpWorkerNodes = oct_background:get_provider_nodes(krakow),
      OpPanelNodes = oct_background:get_provider_panels(krakow),
      ct:pal("ProviderId: ~p", [ProviderId]),
  
      OpDomain = ?GET_DOMAIN_BIN(hd(OpWorkerNodes)),
      OpName = hd(binary:split(OpDomain, <<".">>)),
  
      ExpDetails = #{
          <<"name">> => OpName,
          <<"domain">> => OpDomain,
          <<"onezoneDomainName">> => ?GET_DOMAIN_BIN(?OZ_NODE(Config)),
          <<"id">> => ProviderId,
          % Below values are defined in k8s charts
          <<"geoLatitude">> => 50.0647,
          <<"geoLongitude">> => 19.945,
          <<"adminEmail">> => <<"getting-started@onedata.org">>,
          <<"subdomainDelegation">> => false
      },
  
      ?assert(api_test_runner:run_tests(Config, [
          #scenario_spec{
  
negative.code:                 path = <<"providers/", ProviderId/binary>>
              } end,
  
              validate_result_fun = api_test_validate:http_200_ok(fun(RespBody) ->
                  ExpDetails = get_expected_provider_details(Provider),
                  ?assertEqual(ExpDetails, RespBody)
              end)
          }
      ])).
  
  
  %% @private
  -spec get_expected_provider_details(atom() | binary()) -> map().
  get_expected_provider_details(Provider) ->
      ProviderId = oct_background:get_provider_id(Provider),
      OpWorkerNodes = oct_background:get_provider_nodes(Provider),
      OpDomain = ?GET_DOMAIN_BIN(hd(OpWorkerNodes)),
      OpName = hd(binary:split(OpDomain, <<".">>)),
      Localization = case oct_background:to_entity_placeholder(Provider) of
          krakow -> #{
              <<"geoLatitude">> => 50.0647,
              <<"geoLongitude">> => 19.945
          };
          paris -> #{
              <<"geoLatitude">> => 48.8566,
              <<"geoLongitude">> => 2.3522
          }
      end,
  
      maps:merge(Localization, #{
          <<"name">> => OpName,
          <<"domain">> => OpDomain,
          <<"id">> => ProviderId,
          <<"online">> => true
      }).
  
  
  get_op_test_image_test(Config) ->
      get_op_test_image_test_base(Config, krakow),
      get_op_test_image_test_base(Config, paris).
  
  
  %% @private
  get_op_test_image_test_base(Config, Provider) ->
      ProviderId = oct_background:get_provider_id(Provider),
      OpPanelNodes = oct_background:get_provider_panels(Provider),
  
      ?assert(api_test_runner:run_tests(Config, [
          #scenario_spec{
              name = <<"Get provider details using /providers rest endpoint">>,
              type = rest,
              target_nodes = OpPanelNodes,
              client_spec = #client_spec{
                  correct = [
                      root,
                      member,
                      guest,
                      peer
                  ],
                  unauthorized = [
                      {user, ?ERROR_TOKEN_SERVICE_FORBIDDEN(?SERVICE(?OP_PANEL, ProviderId))}
                      | ?INVALID_API_CLIENTS_AND_AUTH_ERRORS
                  ]
              },
              prepare_args_fun = fun(_) -> #rest_args{
                  method = get,
                  path = <<"test_image">>
              } end,
  
              validate_result_fun = api_test_validate:http_200_ok(fun(RespBody) ->
                  ?assertEqual(?TEST_IMAGE, RespBody)
              end)
          }
      ])).
  
  
  %%%===================================================================
  