anchor.diff:          register_user(?USER_NAME3, ProviderId, Config, ProviderReqParams),
   
       GID = create_group(?GROUP_NAME1, UserReqParams1),
  -
  -    InvitationToken = get_group_invitation_token(GID, UserReqParams1),
  -
  -    %% add user to group
  -    join_user_to_group(InvitationToken, UserReqParams2),
  -
  -    SID = create_space_for_user(?SPACE_NAME1, UserReqParams2),
  -
  -    Users = [{UserId1, UserReqParams1}, {UserId2, UserReqParams2}, {UserId3, UserReqParams3}],
  -    group_privileges_check(?GROUP_PRIVILEGES, Users, GID, SID).
  -
  -group_creates_space_test(Config) ->
  -    UserReqParams1 = ?config(userReqParams, Config),
  -
  -    GID = create_group(?GROUP_NAME1, UserReqParams1),
  -    SID1 = create_space_for_group(?SPACE_NAME1, GID, UserReqParams1),
  -
  -    ?assertMatch([SID1], get_group_spaces(GID, UserReqParams1)).
  -
  -get_space_info_by_group_test(Config) ->
  -    UserReqParams1 = ?config(userReqParams, Config),
  -
  -    GID = create_group(?GROUP_NAME1, UserReqParams1),
  -    SID1 = create_space_for_group(?SPACE_NAME1, GID, UserReqParams1),
  -
  -    ?assertMatch([SID1, ?SPACE_NAME1], get_space_info_by_group(GID, SID1, UserReqParams1)).
  -
  -last_group_leaves_space_test(Config) ->
  -    UserReqParams1 = ?config(userReqParams, Config),
  -
  -    GID = create_group(?GROUP_NAME1, UserReqParams1),
  -    SID1 = create_space_for_group(?SPACE_NAME1, GID, UserReqParams1),
  -
  -    ?assertMatch(ok, check_status(group_leaves_space(GID, SID1, UserReqParams1))),
  -    ?assertMatch(false, is_included([SID1], get_group_spaces(GID, UserReqParams1))).
  -
  -not_last_group_leaves_space_test(Config) ->
  -    ProviderId1 = ?config(providerId, Config),
  -    ProviderReqParams1 = ?config(providerReqParams, Config),
  -    UserReqParams1 = ?config(userReqParams, Config),
  -
  -    {_UserId2, UserReqParams2} =
  -        register_user(?USER_NAME2, ProviderId1, Config, ProviderReqParams1),
  -
  -    GID1 = create_group(?GROUP_NAME1, UserReqParams1),
  -    GID2 = create_group(?GROUP_NAME1, UserReqParams2),
  -
  -    SID1 = create_space_for_group(?SPACE_NAME1, GID1, UserReqParams1),
  -
  -    InvitationToken = get_space_invitation_token(groups, SID1, UserReqParams1),
  -    join_group_to_space(InvitationToken, GID2, UserReqParams2),
  -
  -    ?assertMatch(ok, check_status(group_leaves_space(GID2, SID1, UserReqParams2))),
  -    ?assertMatch([SID1], get_group_spaces(GID1, UserReqParams1)),
  -    ?assertMatch(false, is_included([SID1], get_group_spaces(GID2, UserReqParams2))).
  -
  -invite_group_to_space_test(Config) ->
  -    UserReqParams1 = ?config(userReqParams, Config),
  -
  -    GID = create_group(?GROUP_NAME1, UserReqParams1),
  -    SID = create_space_for_user(?SPACE_NAME2, UserReqParams1),
  -
  -    InvitationToken = get_space_invitation_token(groups, SID, UserReqParams1),
  -
  -    ?assertMatch(SID, join_group_to_space(InvitationToken, GID, UserReqParams1)),
  -    ?assertMatch([SID], get_group_spaces(GID, UserReqParams1)).
  -
  -%% spaces_rest_module_test_group =======================================
  -
  -create_space_by_user_test(Config) ->
  -    UserReqParams = ?config(userReqParams, Config),
  -
  -    SID = create_space(?SPACE_NAME1, UserReqParams),
  -
  -    ?assertMatch([SID, ?SPACE_NAME1], get_space_info(SID, UserReqParams)).
  -
  -create_and_support_space_test(Config) ->
  -    ProviderReqParams = ?config(providerReqParams, Config),
  -    UserReqParams = ?config(userReqParams, Config),
  -
  -    Token = get_space_creation_token_for_user(UserReqParams),
  -    SID = create_space(Token, ?SPACE_NAME1, ?SPACE_SIZE1, ProviderReqParams),
  -
  -    ?assertMatch([SID, ?SPACE_NAME1], get_space_info(SID, ProviderReqParams)).
  -
  -update_space_test(Config) ->
  -    UserReqParams = ?config(userReqParams, Config),
  -
  -    SID = create_space(?SPACE_NAME1, UserReqParams),
  -
  -    ?assertMatch(ok, check_status(update_space(?SPACE_NAME2, SID, UserReqParams))),
  -    ?assertMatch([SID, ?SPACE_NAME2], get_space_info(SID, UserReqParams)).
  -
  -delete_space_test(Config) ->
  -    UserReqParams = ?config(userReqParams, Config),
  -
  -    SID = create_space(?SPACE_NAME1, UserReqParams),
  -    ?assertMatch(ok, check_status(delete_space(SID, UserReqParams))).
  -
  -get_users_from_space_test(Config) ->
  -    ProviderId = ?config(providerId, Config),
  -    ProviderReqParams = ?config(providerReqParams, Config),
  -    UserId1 = ?config(userId, Config),
  -    UserReqParams1 = ?config(userReqParams, Config),
  -
  -    {UserId2, UserReqParams2} =
  -        register_user(?USER_NAME2, ProviderId, Config, ProviderReqParams),
  -
  -    SID = create_space(?SPACE_NAME1, UserReqParams1),
  -
  -    InvitationToken = get_space_invitation_token(users, SID, UserReqParams1),
  -
  -    join_user_to_space(InvitationToken, UserReqParams2),
  -    ?assertMatch(true, is_included([UserId1, UserId2], get_space_users(SID, UserReqParams1))).
  -
  -get_user_info_from_space_test(Config) ->
  -    UserId1 = ?config(userId, Config),
  -    UserReqParams1 = ?config(userReqParams, Config),
  -
  -    SID = create_space(?SPACE_NAME1, UserReqParams1),
  -
  -    ?assertMatch([UserId1, ?USER_NAME1], get_user_info_from_space(SID, UserId1, UserReqParams1)).
  -
  -delete_user_from_space_test(Config) ->
  -    ProviderId = ?config(providerId, Config),
  -    ProviderReqParams = ?config(providerReqParams, Config),
  -    UserReqParams1 = ?config(userReqParams, Config),
  -
  -    {UserId2, UserReqParams2} =
  -        register_user(?USER_NAME2, ProviderId, Config, ProviderReqParams),
  -
  -    SID = create_space(?SPACE_NAME1, UserReqParams1),
  -    Token = get_space_invitation_token(users, SID, UserReqParams1),
  -    join_user_to_space(Token, UserReqParams2),
  -
  -    ?assertMatch(ok, check_status(delete_user_from_space(SID, UserId2, UserReqParams1))),
  -    ?assertMatch(false, is_included([UserId2], get_space_users(SID, UserReqParams1))).
  -
  -get_groups_from_space_test(Config) ->
  -    UserReqParams = ?config(userReqParams, Config),
  -
  -    GID1 = create_group(?GROUP_NAME1, UserReqParams),
  -    SID = create_space_for_group(?SPACE_NAME1, GID1, UserReqParams),
  -
  -    ?assertMatch(true, is_included([GID1], get_space_groups(SID, UserReqParams))).
  -
  -get_group_info_from_space_test(Config) ->
  -    UserReqParams = ?config(userReqParams, Config),
  -
  -    GID1 = create_group(?GROUP_NAME1, UserReqParams),
  -    SID = create_space_for_group(?SPACE_NAME1, GID1, UserReqParams),
  -
  -    ?assertMatch([GID1, ?GROUP_NAME1], get_group_from_space(SID, GID1, UserReqParams)).
  -
  -delete_group_from_space_test(Config) ->
  -    UserReqParams = ?config(userReqParams, Config),
  -
  -    GID1 = create_group(?GROUP_NAME1, UserReqParams),
  -    SID = create_space_for_group(?SPACE_NAME1, GID1, UserReqParams),
  -
  -    ?assertMatch(ok, check_status(delete_group_from_space(SID, GID1, UserReqParams))).
  -
  -get_providers_supporting_space_test(Config) ->
  -    ProviderId = ?config(providerId, Config),
  -    ProviderReqParams = ?config(providerReqParams, Config),
  -    UserReqParams = ?config(userReqParams, Config),
  -
  -    Token = get_space_creation_token_for_user(UserReqParams),
  -    SID = create_and_support_space(Token, ?SPACE_NAME1, ?SPACE_SIZE1, ProviderReqParams),
  -
  -    ?assertMatch([ProviderId], get_supporting_providers(SID, UserReqParams)).
  -
  -get_info_of_provider_supporting_space_test(Config) ->
  -    ProviderId = ?config(providerId, Config),
  -    ProviderReqParams = ?config(providerReqParams, Config),
  -    UserReqParams = ?config(userReqParams, Config),
  -
  -    Token = get_space_creation_token_for_user(UserReqParams),
  -    SID = create_and_support_space(Token, ?SPACE_NAME1, ?SPACE_SIZE1, ProviderReqParams),
  -
  -    ?assertMatch(
  -        [?CLIENT_NAME1, ProviderId, ?URLS1, ?REDIRECTION_POINT1],
  -        get_supporting_provider_info(SID, ProviderId, UserReqParams)
  -    ).
  -
  -delete_provider_supporting_space_test(Config) ->
  -    ProviderId = ?config(providerId, Config),
  -    ProviderReqParams = ?config(providerReqParams, Config),
  -    UserReqParams = ?config(userReqParams, Config),
  -
  -    Token = get_space_creation_token_for_user(UserReqParams),
  -    SID = create_and_support_space(Token, ?SPACE_NAME1, ?SPACE_SIZE1, ProviderReqParams),
  -
  -    ?assertMatch(ok, check_status(delete_supporting_provider(SID, ProviderId, UserReqParams))),
  -    ?assertMatch([], get_supporting_providers(SID, UserReqParams)).
  -
  -get_space_privileges_test(Config) ->
  -    ProviderId = ?config(providerId, Config),
  -    ProviderReqParams = ?config(providerReqParams, Config),
  -    UserId1 = ?config(userId, Config),
  -    UserReqParams1 = ?config(userReqParams, Config),
  -
  -    {UserId2, UserReqParams2} =
  -        register_user(?USER_NAME2, ProviderId, Config, ProviderReqParams),
  -
       SID = create_space_for_user(?SPACE_NAME1, UserReqParams1),
       InvitationToken = get_space_invitation_token(users, SID, UserReqParams1),
       join_user_to_space(InvitationToken, UserReqParams2),
   
  -    ?assertMatch(true,
  -        is_included(
  -            [atom_to_binary(Privilege, latin1) || Privilege <- ?SPACE_PRIVILEGES],
  -            get_space_privileges(users, SID, UserId1, UserReqParams1)
  -        )
  -    ),
  -
  -    ?assertMatch(true,
  -        is_included([<<"space_view_data">>], get_space_privileges(users, SID, UserId2, UserReqParams1))).
  -
  -set_space_privileges_test(Config) ->
  -    ProviderId = ?config(providerId, Config),
  -    ProviderReqParams = ?config(providerReqParams, Config),
  -    UserId1 = ?config(userId, Config),
  -    UserReqParams1 = ?config(userReqParams, Config),
  -
  -    {UserId2, UserReqParams2} =
  -        register_user(?USER_NAME2, ProviderId, Config, ProviderReqParams),
  -    {UserId3, UserReqParams3} =
  -        register_user(?USER_NAME3, ProviderId, Config, ProviderReqParams),
  -
  -    GID = create_group(?GROUP_NAME1, UserReqParams1),
  -    SID = create_space_for_user(?SPACE_NAME1, UserReqParams1),
  -    InvitationToken = get_space_invitation_token(users, SID, UserReqParams1),
  -    join_user_to_space(InvitationToken, UserReqParams2),
  -
       Users = [{UserId1, UserReqParams1}, {UserId2, UserReqParams2}, {UserId3, UserReqParams3}],
   
  -    space_privileges_check(?SPACE_PRIVILEGES, Users, GID, SID).
  +    space_privileges_check(?SPACE_PRIVILEGES, Users, GID, SID)
  +catch T:M ->
  +ct:print("OMG2: ~p", [{T, M, erlang:get_stacktrace()}])
  +end.
   
   bad_request_test(Config) ->
       UserReqParams = ?config(userReqParams, Config),
  
positive.code:     "Body = ~p,~n"
      "Options = ~p,~n"
      "response: ~p~n",
          [Method, Endpoint, Headers, Body, [insecure, {pool, RandomPoolName} | Options], Res]),
      Res.
  
  get_macaroon_id(Token) ->
  
negative.code:     ].
  
  end_per_testcase(_, Config) ->
      % Stop hackney pools
      ok = hackney_pool:stop_pool(auth),
      ok = hackney_pool:stop_pool(no_auth),
      % Stop hackney and ssl2
      hackney:stop(),
      application:stop(ssl2),
      {KeyFile, CSRFile, CertFile} = ?config(cert_files, Config),
      file:delete(KeyFile),
      file:delete(CSRFile),
      file:delete(CertFile).
  
  end_per_suite(Config) ->
      test_node_starter:clean_environment(Config).
  
  %%%===================================================================
  