=== Test case: rest_SUITE:user_can_be_registered_and_removed/1 (click for source code)

=== Config value:

    [{watchdog,<0.13681.1>},
     {{ejabberd_cwd,mongooseim@localhost},
      "/home/circleci/project/_build/mim1/rel/mongooseim"},
     {mam_backend,disabled},
     {mim_data_dir,"/home/circleci/project/big_tests/tests/rest_SUITE_data"},
     {preset,"internal_mnesia"},
     {tc_logfile,"/home/circleci/project/big_tests/ct_report/ct_run.test@34a9b6d2516c.2022-01-27_15.25.07/big_tests.tests.rest_SUITE.logs/run.2022-01-27_15.35.34/rest_suite.user_can_be_registered_and_removed.73730.html"},
     {tc_group_properties,[{name,admin},parallel]},
     {tc_group_path,[]},
     {data_dir,"/home/circleci/project/big_tests/_build/default/lib/mongoose_tests/ebin/rest_SUITE_data/"},
     {priv_dir,"/home/circleci/project/big_tests/ct_report/ct_run.test@34a9b6d2516c.2022-01-27_15.25.07/big_tests.tests.rest_SUITE.logs/run.2022-01-27_15.35.34/log_private/"},
     {escalus_users,[{alice,[{username,<<"alicE">>},
                             {server,<<"localhost">>},
                             {password,<<"matygrysa">>}]},
                     {bob,[{username,<<"bOb">>},
                           {server,<<"localhost">>},
                           {password,<<"makrolika">>}]}]}]

=== Current directory is "/home/circleci/project/big_tests/ct_report/ct_run.test@34a9b6d2516c.2022-01-27_15.25.07"

=== Started at 2022-01-27 15:35:34


*** CT 2022-01-27 15:35:34.890 *** View log from node mongooseim@localhost when started mongooseim@localhost_5143.html
*** CT 2022-01-27 15:35:34.891 *** View log from node ejabberd2@localhost when started ejabberd2@localhost_2357.html

*** User 2022-01-27 15:35:34.905 ***
REST request:
Code: 200
Req: {<0.13830.1>,<<"/api/users/localhost">>,<<"GET">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"e2b7afeb58cbfafc">>}],
      <<>>}
Result: {{<<"200">>,<<"OK">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Thu, 27 Jan 2022 15:35:34 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"326">>}],
         <<"[\"alice@localhost\",\"alice_disco_features_1012@localhost\",\"alice_disco_features_with_mam_1013@localhost\",\"alice_disco_info_1014@localhost\",\"alice_disco_info_with_mam_1016@localhost\",\"alice_disco_service_1011@localhost\",\"alice_messages_error_handling_1338@localhost\",\"alice_session_can_be_kicked_1337@localhost\",\"bob@localhost\"]">>,
         451,653}
Params: #{body => <<>>,method => <<"GET">>,path => <<"/api/users/localhost">>,
          return_headers => true,role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-01-27 15:35:34.907 ***
REST request:
Code: 201
Req: {<0.13835.1>,<<"/api/users/localhost">>,<<"POST">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"d6d31e1e17c21ed3">>}],
      <<"{\"username\":\"mike\",\"password\":\"nicniema\"}">>}
Result: {{<<"201">>,<<"Created">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"location">>,
           <<"http://localhost:8088/api/users/localhost/User mike@localhost successfully registered">>},
          {<<"date">>,<<"Thu, 27 Jan 2022 15:35:34 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"43">>}],
         <<"User mike@localhost successfully registered">>,269,689}
Params: #{body => <<"{\"username\":\"mike\",\"password\":\"nicniema\"}">>,
          method => <<"POST">>,path => <<"/api/users/localhost">>,
          return_headers => true,role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-01-27 15:35:34.910 ***
REST request:
Code: 200
Req: {<0.13843.1>,<<"/api/users/localhost">>,<<"GET">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"83c9dd93b0884e88">>}],
      <<>>}
Result: {{<<"200">>,<<"OK">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Thu, 27 Jan 2022 15:35:34 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"598">>}],
         <<"[\"alice@localhost\",\"alice_disco_features_1012@localhost\",\"alice_disco_features_with_mam_1013@localhost\",\"alice_disco_info_1014@localhost\",\"alice_disco_info_with_mam_1016@localhost\",\"alice_disco_service_1011@localhost\",\"alice_messages_are_sent_and_received_1340@localhost\",\"alice_messages_error_handling_1338@localhost\",\"alice_session_can_be_kicked_1337@localhost\",\"alice_stanzas_are_sent_and_received_1339@localhost\",\"bob@localhost\",\"bob_messages_are_sent_and_received_1340@localhost\",\"bob_messages_error_handling_1338@localhost\",\"bob_stanzas_are_sent_and_received_1339@localhost\",\"mike@localhost\"]">>,
         723,1899}
Params: #{body => <<>>,method => <<"GET">>,path => <<"/api/users/localhost">>,
          return_headers => true,role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-01-27 15:35:34.915 ***
REST request fails:
Code: 403
Req: {<0.13865.1>,<<"/api/users/localhost">>,<<"POST">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"b52950f91b721038">>}],
      <<"{\"username\":\"mike\",\"password\":\"nicniema\"}">>}
Result: {{<<"403">>,<<"Forbidden">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Thu, 27 Jan 2022 15:35:34 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"67">>}],
         <<"User mike@localhost already registered at node mongooseim@localhost">>,
         198,1308}
Params: #{body => <<"{\"username\":\"mike\",\"password\":\"nicniema\"}">>,
          method => <<"POST">>,path => <<"/api/users/localhost">>,
          return_headers => true,role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-01-27 15:35:34.917 ***
REST request:
Code: 204
Req: {<0.13880.1>,<<"/api/users/localhost/mike">>,<<"DELETE">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"21b025fcb3b60b10">>}],
      <<>>}
Result: {{<<"204">>,<<"No Content">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Thu, 27 Jan 2022 15:35:34 GMT">>},
          {<<"content-type">>,<<"application/json">>}],
         <<>>,112,1277}
Params: #{body => <<>>,method => <<"DELETE">>,
          path => <<"/api/users/localhost/mike">>,return_headers => true,
          role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-01-27 15:35:34.919 ***
REST request:
Code: 200
Req: {<0.13886.1>,<<"/api/users/localhost">>,<<"GET">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"f7ab2e0a72ee836b">>}],
      <<>>}
Result: {{<<"200">>,<<"OK">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Thu, 27 Jan 2022 15:35:34 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"581">>}],
         <<"[\"alice@localhost\",\"alice_disco_features_1012@localhost\",\"alice_disco_features_with_mam_1013@localhost\",\"alice_disco_info_1014@localhost\",\"alice_disco_info_with_mam_1016@localhost\",\"alice_disco_service_1011@localhost\",\"alice_messages_are_sent_and_received_1340@localhost\",\"alice_messages_error_handling_1338@localhost\",\"alice_session_can_be_kicked_1337@localhost\",\"alice_stanzas_are_sent_and_received_1339@localhost\",\"bob@localhost\",\"bob_messages_are_sent_and_received_1340@localhost\",\"bob_messages_error_handling_1338@localhost\",\"bob_stanzas_are_sent_and_received_1339@localhost\"]">>,
         706,566}
Params: #{body => <<>>,method => <<"GET">>,path => <<"/api/users/localhost">>,
          return_headers => true,role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-01-27 15:35:34.921 ***
REST request fails:
Code: 400
Req: {<0.13899.1>,<<"/api/users/localhost">>,<<"POST">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"16314793e4963b75">>}],
      <<"{\"username\":\"m@ke\",\"password\":\"nicniema\"}">>}
Result: {{<<"400">>,<<"Bad Request">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Thu, 27 Jan 2022 15:35:34 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"26">>}],
         <<"Invalid JID m@ke@localhost">>,159,674}
Params: #{body => <<"{\"username\":\"m@ke\",\"password\":\"nicniema\"}">>,
          method => <<"POST">>,path => <<"/api/users/localhost">>,
          return_headers => true,role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-01-27 15:35:34.922 ***
REST request fails:
Code: 400
Req: {<0.13910.1>,<<"/api/users/localhost/@mike">>,<<"DELETE">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"2a07004206548f4d">>}],
      <<>>}
Result: {{<<"400">>,<<"Bad Request">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Thu, 27 Jan 2022 15:35:34 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"11">>}],
         <<"Invalid JID">>,144,618}
Params: #{body => <<>>,method => <<"DELETE">>,
          path => <<"/api/users/localhost/@mike">>,return_headers => true,
          role => admin,
          server => #{node => mongooseim@localhost}}

*** CT 2022-01-27 15:35:34.927 *** View log from node ejabberd2@localhost when finished ejabberd2@localhost_2357.html
*** CT 2022-01-27 15:35:34.928 *** View log from node mongooseim@localhost when finished mongooseim@localhost_5143.html



=== Ended at 2022-01-27 15:35:34
=== successfully completed test case
=== === Returned value: ok