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

=== Config value:

    [{watchdog,<0.7719.2>},
     {{ejabberd_cwd,mongooseim@localhost},
      "/home/circleci/project/_build/mim1/rel/mongooseim"},
     {mam_backend,rdbms},
     {mim_data_dir,"/home/circleci/project/big_tests/tests/rest_SUITE_data"},
     {preset,"odbc_mssql_mnesia"},
     {tc_logfile,"/home/circleci/project/big_tests/ct_report/ct_run.test@ebe8a8f9fc53.2022-01-25_16.21.59/big_tests.tests.rest_SUITE.logs/run.2022-01-25_16.34.19/rest_suite.user_can_be_registered_and_removed.117763.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@ebe8a8f9fc53.2022-01-25_16.21.59/big_tests.tests.rest_SUITE.logs/run.2022-01-25_16.34.19/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@ebe8a8f9fc53.2022-01-25_16.21.59"

=== Started at 2022-01-25 16:34:20


*** CT 2022-01-25 16:34:20.047 *** View log from node mongooseim@localhost when started mongooseim@localhost_5707.html
*** CT 2022-01-25 16:34:20.047 *** View log from node ejabberd2@localhost when started ejabberd2@localhost_2377.html

*** User 2022-01-25 16:34:20.070 ***
REST request:
Code: 200
Req: {<0.7869.2>,<<"/api/users/localhost">>,<<"GET">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"ba2eef0f1c645d02">>}],
      <<>>}
Result: {{<<"200">>,<<"OK">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Tue, 25 Jan 2022 16:34:19 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"134">>}],
         <<"[\"alice@localhost\",\"alice_messages_are_sent_and_received_2207@localhost\",\"alice_session_can_be_kicked_2206@localhost\",\"bob@localhost\"]">>,
         259,1970}
Params: #{body => <<>>,method => <<"GET">>,path => <<"/api/users/localhost">>,
          return_headers => true,role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-01-25 16:34:20.075 ***
REST request:
Code: 201
Req: {<0.7875.2>,<<"/api/users/localhost">>,<<"POST">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"05cd3eb9d9d068fe">>}],
      <<"{\"username\":\"mike\",\"password\":\"nicniema\"}">>}
Result: {{<<"201">>,<<"Created">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"location">>,
           <<"http://localhost:8088/api/users/localhost/User mike@localhostsuccessfully registered">>},
          {<<"date">>,<<"Tue, 25 Jan 2022 16:34:19 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"42">>}],
         <<"User mike@localhostsuccessfully registered">>,267,3809}
Params: #{body => <<"{\"username\":\"mike\",\"password\":\"nicniema\"}">>,
          method => <<"POST">>,path => <<"/api/users/localhost">>,
          return_headers => true,role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-01-25 16:34:20.078 ***
REST request:
Code: 200
Req: {<0.7886.2>,<<"/api/users/localhost">>,<<"GET">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"e86d172782184b2e">>}],
      <<>>}
Result: {{<<"200">>,<<"OK">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Tue, 25 Jan 2022 16:34:19 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"493">>}],
         <<"[\"alice@localhost\",\"alice_messages_are_archived_2211@localhost\",\"alice_messages_are_sent_and_received_2207@localhost\",\"alice_messages_can_be_paginated_2210@localhost\",\"alice_messages_error_handling_2209@localhost\",\"alice_session_can_be_kicked_2206@localhost\",\"alice_stanzas_are_sent_and_received_2208@localhost\",\"bob@localhost\",\"bob_messages_are_sent_and_received_2207@localhost\",\"bob_messages_error_handling_2209@localhost\",\"bob_stanzas_are_sent_and_received_2208@localhost\",\"mike@localhost\"]">>,
         618,1474}
Params: #{body => <<>>,method => <<"GET">>,path => <<"/api/users/localhost">>,
          return_headers => true,role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-01-25 16:34:20.081 ***
REST request fails:
Code: 403
Req: {<0.7895.2>,<<"/api/users/localhost">>,<<"POST">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"579a06e880c99034">>}],
      <<"{\"username\":\"mike\",\"password\":\"nicniema\"}">>}
Result: {{<<"403">>,<<"Forbidden">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Tue, 25 Jan 2022 16:34:19 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"67">>}],
         <<"User mike@localhost already registered at node mongooseim@localhost">>,
         198,1463}
Params: #{body => <<"{\"username\":\"mike\",\"password\":\"nicniema\"}">>,
          method => <<"POST">>,path => <<"/api/users/localhost">>,
          return_headers => true,role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-01-25 16:34:20.139 ***
REST request:
Code: 204
Req: {<0.7901.2>,<<"/api/users/localhost/mike">>,<<"DELETE">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"be5ed22a41f88aca">>}],
      <<>>}
Result: {{<<"204">>,<<"No Content">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Tue, 25 Jan 2022 16:34:19 GMT">>},
          {<<"content-type">>,<<"application/json">>}],
         <<>>,112,57080}
Params: #{body => <<>>,method => <<"DELETE">>,
          path => <<"/api/users/localhost/mike">>,return_headers => true,
          role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-01-25 16:34:20.141 ***
REST request:
Code: 200
Req: {<0.7949.2>,<<"/api/users/localhost">>,<<"GET">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"57fd86dab5c628e2">>}],
      <<>>}
Result: {{<<"200">>,<<"OK">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Tue, 25 Jan 2022 16:34:19 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"566">>}],
         <<"[\"alice@localhost\",\"alice_messages_are_archived_2211@localhost\",\"alice_messages_are_sent_and_received_2207@localhost\",\"alice_messages_can_be_paginated_2210@localhost\",\"alice_messages_error_handling_2209@localhost\",\"alice_session_can_be_kicked_2206@localhost\",\"alice_stanzas_are_sent_and_received_2208@localhost\",\"bob@localhost\",\"bob_messages_are_archived_2211@localhost\",\"bob_messages_are_sent_and_received_2207@localhost\",\"bob_messages_can_be_paginated_2210@localhost\",\"bob_messages_error_handling_2209@localhost\",\"bob_stanzas_are_sent_and_received_2208@localhost\"]">>,
         691,1225}
Params: #{body => <<>>,method => <<"GET">>,path => <<"/api/users/localhost">>,
          return_headers => true,role => admin,
          server => #{node => mongooseim@localhost}}


*** User 2022-01-25 16:34:20.143 ***
REST request fails:
Code: 400
Req: {<0.7958.2>,<<"/api/users/localhost">>,<<"POST">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"67f799ef14970fff">>}],
      <<"{\"username\":\"m@ke\",\"password\":\"nicniema\"}">>}
Result: {{<<"400">>,<<"Bad Request">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Tue, 25 Jan 2022 16:34:19 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"27">>}],
         <<"Invalid jid: m@ke@localhost">>,160,717}
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-25 16:34:20.146 ***
REST request fails:
Code: 400
Req: {<0.7965.2>,<<"/api/users/localhost/@mike">>,<<"DELETE">>,
      [{<<"Content-Type">>,<<"application/json">>},
       {<<"Request-Id">>,<<"f8525e9a0cfaae01">>}],
      <<>>}
Result: {{<<"400">>,<<"Bad Request">>},
         [{<<"server">>,<<"Cowboy">>},
          {<<"date">>,<<"Tue, 25 Jan 2022 16:34:19 GMT">>},
          {<<"content-type">>,<<"application/json">>},
          {<<"content-length">>,<<"40">>}],
         <<"Invalid jid: <<\"@mike\">>@<<\"localhost\">>">>,173,2074}
Params: #{body => <<>>,method => <<"DELETE">>,
          path => <<"/api/users/localhost/@mike">>,return_headers => true,
          role => admin,
          server => #{node => mongooseim@localhost}}

*** CT 2022-01-25 16:34:20.150 *** View log from node ejabberd2@localhost when finished ejabberd2@localhost_2377.html
*** CT 2022-01-25 16:34:20.151 *** View log from node mongooseim@localhost when finished mongooseim@localhost_5708.html



=== Ended at 2022-01-25 16:34:20
=== successfully completed test case
=== === Returned value: ok